It is right. Collections keep track of the last identifier that was created and assign the value a lastId + 1 to the $loki property of the next object that you insert into the collection. You can check the value of the last id by checking collection.maxId and print the next id by simply adding 1 to this.
source share