Does Lokijs generates its own IDs?

312 Views Asked by At

I've been trying to use lokijs on a project.

Does Lokijs generates its own IDs? Or do we need to handle that our selves?

1

There are 1 best solutions below

0
On BEST ANSWER

LokiJS generates its own ids. Since the property "id" is a common name, to avoid clashes the unique id of an object inserted in a collection is stored in the property $loki. The other loki-generated data is the meta object containing information about the object creation and last update, as well as the revision number (number of times an object was modified).