[SOLVED] Error: Cannot do exclusion on field _id in inclusion projection, collectionName=users

Hi,

Since I have upgraded to 2.6.0, I have the following error:

Error: Cannot do exclusion on field _id in inclusion projection, collectionName=users

When I run the code below

return Meteor.users.findOne(
			{ _id: this.userId },
			{ fields: { settings: 1, _id: 0 } }
		);

It worked before and seems to be Ok in regards to:

https://docs.meteor.com/api/collections.html#fieldspecifiers

Any idea ?

Thanks

I’ve got this error, haven’t tried again yet. To solve this I had to change all projection files to 1 or 0, not mixing them together.

The issue is that I don’t want the _id field and based on the documentation it is the only one that can be excluded in the inclusion projection.

Hi @harry73 and @minhna, can you update your mongo package version to mongo@1.14.4? I believe that this issue was solved recently in this PR.

1 Like

Hi @fredmaiaarantes , it works. Thanks a lot.

1 Like