-
Notifications
You must be signed in to change notification settings - Fork 72
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
MongoDB Emulation Mode #46
Comments
maybe just |
@YuriSolovyov Not sure I follow... could you write the usage in code? |
@Irrelon I mean instead of
use
or
just to get rid of |
@YuriSolovyov Ahh I see. That approach is more terse but increases code size by adding 3 methods to the class instead of 1.
By using a dynamic getter / setter we reduce all these actions down to 1 method call:
Dynamic getter/setter methods are used throughout ForerunnerDB and are also familiar to those using other libraries like jQuery which make extensive use of them as well. |
ok, good point. |
Dev branch now has mongoEmulation() method on fdb, db and collection instances. Find, update and remove all tested and working with dot notation-based queries. Can you guys give it a try and let me know your results? |
I haven't implemented the ForerunnerDB in the project I'm working on (when I got involved in the previous issue thread I was comparing and this issue came up), so I can't check the behaviour to verify for you at this point (we moved on and implemented another library) - my apologies! However, this does make it a contender again once we do, which will be soon enough. |
Out of interest what library did you go with? |
I used NeDB (this part of the project is Node.js-based) as an in-memory cache. There's still a requirement for a browser storage component, and if we went with NeDB for that then that would still leave a requirement to abstract the browser storage; NeDB seems to be designed more as a fast, file-backed solution, although it will work in the browser too. We're not using LocalForage yet but it does seem to be the way to go, and obviously ForerunnerDB has that covered. |
This is an issue set up to track a new enhancement to make ForerunnerDB optionally behave exactly like MongoDB when doing CRUD calls.
find - Handle dot-notation style query keys.
update - Assume replace instead of update by default.
Implementation is currently suggested to be:
The text was updated successfully, but these errors were encountered: