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.connectto specify a different server. Passnullto specify no connection. Unmanaged (nameis null) collections cannot specify a connection. - idGeneration String
-
The method of generating the
_idfields of new documents in this collection. Possible values:-
'STRING': random strings -
'MONGO': randomMongo.ObjectIDvalues
The default id generation technique is
'STRING'. -
- transform Function
-
An optional transformation function. Documents will be passed through this function before being returned from
fetchorfindOne, and before being passed to callbacks ofobserve,map,forEach,allow, anddeny. Transforms are not applied for the callbacks ofobserveChangesor to cursors returned from publish functions.
Please login to continue.