Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document which MongoDB compatible queries #62

Closed
vdininski opened this issue Jan 20, 2015 · 5 comments
Closed

Document which MongoDB compatible queries #62

vdininski opened this issue Jan 20, 2015 · 5 comments

Comments

@vdininski
Copy link

Given the interest in lokijs' MongoDB compatibility it seems odd that there is no mention in the documentation as to what exactly is supported in terms of queries/methods.

Is there a one place where I can find all the currently supported queries?

@techfort
Copy link
Owner

Hi Vasil,
thank you for raising the issue.
MongoDB compatibility is an ongoing work, LokiJS didn't start with the intent of being MongoDB api compatible, but many users found this would be useful for many reasons, so we're gradually introducing this feature. I will explicitly specify whatever feature is MongoDB compatible in the next release.

@obeliskos
Copy link
Collaborator

The best current source for this is at techfort's website here :
http://lokijs.org/#/docs

It mentions the operators we currently support are :

  • $eq: equal to
  • $gt: greater than
  • $gte: greater than or equal to
  • $lt: less than
  • $lte: less than or equal to
  • $ne: not equal to
  • $contains: contains
  • $regex: use a regex pattern for matching

Each mongo-expression currently supports 1 field/operation for now, blended with javascript 'where' filters and Resultset and DynamicViews to allow chaining multiple 'and' style filters.

As @techfort mentioned, we will be determining features for next release so feel free to request or inquire about specific issues.

@vdininski
Copy link
Author

Thanks for the list! :)
However I'd like to ask whether you are planning on introducing support for $update operators (think $set, $push, $inc, etc) even though from what I see the operations are synchronous?

@techfort
Copy link
Owner

@vdininski $update operators are not going to be supported in the short term, but we are going to implement a merge method which allows to merge a plain js object into a loki one and update the record in the collection. If you need any further help let me know, meanwhile I'm closing this.

@xeoshow
Copy link

xeoshow commented Aug 29, 2018

Hello,

I am new to LokiJS, since it is 2018 now, how about the status for MongoDB API compatibility currently?

Thanks a lot.

Best regards, Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants