dannyconnell / localbase

A Firebase-Style Database ... Offline!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delete Document by Index

JonasHiltl opened this issue · comments

Hello, I just want to know if it's possible to delete a document by it's index . I couldn't find any information about that in the docs.

Isn't it the actual purpose of this paragraph?

In the example the id is a custom field that got manually added and not the index of the document. The index is the # which is seen in this image. The manual id never changes when a document in the collection gets deleted but I think that the index get's adjusted when a document gets added/deleted. So it could be useful to delete by index, when for example the documents are all displayed dynamically in a list and you only know the index of the document that you want to manipulate.

In this case, I'm sorry but I don't have enough experience to provide you with a valid answer.
I'm actually not planning to rely on the "key" of the key/value pair used to store new documents in a collection as I drive my own IDs for the objects/documents I'm manipulating.