Comments (9)
maybe just {enable,disable}MongoEmulation()
?
from forerunnerdb.
@YuriSolovyov Not sure I follow... could you write the usage in code?
from forerunnerdb.
@Irrelon I mean instead of
fdb.mongoEmulation(true);
use
fdb.enableMongoEmulation()
or
fdb.disableMongoEmulation()
just to get rid of true/false
flag.
from forerunnerdb.
@YuriSolovyov Ahh I see.
That approach is more terse but increases code size by adding 3 methods to the class instead of 1.
1: fdb.enableMongoEmulation()
2: fdb.disableMongoEmulation()
3: isEnabled = fdb.isMongoEmulationEnabled()
By using a dynamic getter / setter we reduce all these actions down to 1 method call:
1: fdb.mongoEmulation(true)
2: fdb.mongoEmulation(false)
3: isEnabled = fdb.mongoEmulation()
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.
from forerunnerdb.
ok, good point.
from forerunnerdb.
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?
from forerunnerdb.
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.
from forerunnerdb.
Out of interest what library did you go with?
from forerunnerdb.
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.
from forerunnerdb.
Related Issues (20)
- Clarity about find(); HOT 2
- upsert that resolves to update does not update fields that start with '$' HOT 5
- TypeError: http.IncomingMessage.prototype is not an object or null HOT 6
- Support for $not operator HOT 3
- Interactive Demo HOT 1
- index not used when using query operator
- collection.load is very slow HOT 1
- Loading JSON file into forrunner db file and vice versa ? HOT 8
- Duplicate data when setData and ensureIndex HOT 1
- Adding event listener with an ID does not work HOT 2
- Dropping condition does not remove memory reference
- $replace with new documents?
- How does load work? HOT 2
- using Date query with $gte and $lte operators. HOT 3
- Typescript is outdated HOT 3
- Where can i find the database file?
- Weird query behavior when using elemMatch
- WebWorker import ForerunnerDB
- ⚠️ Web SQL is deprecated
- How to query condition on comparing 2 fields?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forerunnerdb.