Note: You are viewing documentation for version v0 of Node.js. View the latest version.
Node.js - collection.collection()
Get a query-only sub-collection reference, this can be used to query commonly named collections across documents.
import { collection } from '@nitric/sdk'
const enemies = collection('profiles').for('reading').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
import { collection } from '@nitric/sdk'
const enemies = collection('profiles').for('reading').collection('enemies')
const enemiesQuery = enemies.query()