Note: You are viewing documentation for version v0 of Python. View the latest version.
Python - collection.collection()
Get a query-only sub-collection reference, this can be used to query commonly named collections across documents.
from nitric.resources import collection
enemies = collection('profiles').allow('reading','writing').collection('enemies')
Parameters
- Name
name
- Required
- Required
- Type
- string
- Description
The name of the sub-collection to reference.
Examples
Create a query for a sub collection
from nitric.resources import collection
enemies = collection('profiles').allow('reading').collection('enemies')
enemiesQuery = enemies.query()