sergeyksv / tingodb

Embedded Node.js database upward compatible with MongoDB
www.tingodb.com
1.16k stars 105 forks source link

Feature Request: Promise support #181

Open ajmas opened 5 years ago

ajmas commented 5 years ago

It would be good to have promise support added to the project.

A possible implementation would be: if callback is not passed, then return the result via a Promise.

So instead of:

MyCollection.find().limit(20, (results) => { /* ... */ });

it would be:

const results = MyCollection.find().limit(20)

At the same time it would be good to have support for Array functions, such as forEach()

kfirprods commented 4 years ago

Good point. This is a deal breaker for me - it's the only reason I decided to skip tingoDB.

However, the code hasn't been updated for over a year, so we shouldn't hold our hopes up

daniel-stoneuk commented 4 years ago

@kfirprods out of interest, what did you find that supported promises and is similar?

kfirprods commented 4 years ago

@kfirprods out of interest, what did you find that supported promises and is similar?

Eventually I decided to use lowdb

daniel-stoneuk commented 4 years ago

Cheers - looks like a decent alternative.

Shame there's nothing that's compatible with the newer mongodb drivers but this should be fine until I need a scalable database.