Finding latest entry to collections

Not sure why its not working but I’m trying to find the latest entry to a collection.
In meteor shell its working fine and it returns correct results.

My query is this:

GeneralMaterial.findOne({}, {sort: {$natural : -1}})

but when I run it actually I get this: Uncaught Error: unsupported sort key: $natural

Is there something else in Meteor that replaces the $natural?

Are you trying this in the client-side code? Minimongo on the client doesn’t support sort operators like $natural, you can only do that on the server. So you’ve got two options here - either you implement that as a method on the server and call it from the client, or you change your GeneralMaterial collection schema to add an createdAt (or similarly named) field with date of creation, then you can sort by it directly on the client.

Thanks I also figured out that this operator is not supported for client.