Python - collection.doc.collection()
Gets a reference to a child collection on a document.
from nitric.resources import collectionprofiles = collection('profiles').allow('reading')drakes_profile = profiles.doc('Drake Mallard')drakes_enemies = drakes_profile.collection('enemies')
Parameters
- Name
name
- Required
- Required
- Type
- string
- Description
The name of the child collection to reference.
Notes
Document collection relationships can be at most 1 deep.
from nitric.resources import collectionprofiles = collection('profiles').allow('reading')profiles.doc('Drake Mallard').collection('enemies').doc('Steel Beak') // ✔️ We can go this deep.collection('enemies') // ❌ But not this deep
See also
Last updated on Dec 24, 2024