techfort / LokiJS

javascript embeddable / in-memory database
http:/techfort.github.io/LokiJS
MIT License
6.73k stars 482 forks source link

Is there any way to wait for an insert to complete? #886

Closed nabils closed 3 years ago

nabils commented 3 years ago

Insert is currently async but it does not return a promise. As far as I can see there is no way to know when an insert of multiple records to a collection has completed? Is this possible?

Thanks

nabils commented 3 years ago

It does seem to be sync actually. Closing this

jaandrle commented 3 years ago

@nabils Exactly operations above Collections are synchronous. Saving function saveDatabase can be asynchronous and accepts callback.