user3323389
user3323389

Reputation: 11

findOne returns Object instead of Document

Console Object Document

Leads and Customers are both collections. Why does Leads.findOne() return an Object? It should return a Document as Customers.findOne() does.

I am using Meteor 1.2.1.

Upvotes: 1

Views: 68

Answers (1)

Abdelhamid Belarbi
Abdelhamid Belarbi

Reputation: 609

It's because collection Customers has been transformed via the _transform method whilst collection Leads hasn't.

See the transform parameter of Mongo.Collection in the documentation.

It's very likely you are using the dburles:collection-helpers package which adds the transform automatically.

Upvotes: 1

Related Questions