new Mongo.Collection(name, [options])
import { Mongo } from 'meteor/mongo'
Source Constructor for a Collection
Arguments
- name String
-
The name of the collection. If null, creates an unmanaged (unsynchronized) local collection.
Options
- connection Object
-
The server connection that will manage this collection. Uses the default connection if not specified. Pass the return value of calling
DDP.connect
to specify a different server. Passnull
to specify no connection. Unmanaged (name
is null) collections cannot specify a connection. - idGeneration String
-
The method of generating the
_id
fields of new documents in this collection. Possible values:-
'STRING'
: random strings -
'MONGO'
: randomMongo.ObjectID
values
The default id generation technique is
'STRING'
. -
- transform Function
-
An optional transformation function. Documents will be passed through this function before being returned from
fetch
orfindOne
, and before being passed to callbacks ofobserve
,map
,forEach
,allow
, anddeny
. Transforms are not applied for the callbacks ofobserveChanges
or to cursors returned from publish functions.
Please login to continue.