0

I'm sure this has wider implications but here goes:

I want to add a new field to my document - isDeleted

When isDeleted = true; I want to filter it out from queries.


Since I can't use !=, and I can't use < > queries (its boolean, but other documents already have it not set) what is the "right" way to handle augmenting the schema?

I know I can go and update each document to have "isDeleted = false", but a big part of using a schemaless database is that I don't need to stress so much about data all being the same, otherwise I might as well just use a relational database.

Ryan Knell
  • 6,204
  • 2
  • 40
  • 32
  • 1
    "Should I just go back to Mongo?" That's a request for recommending a technology, which is off topic on Stack Overflow. What is your actual question for us? – Frank van Puffelen May 30 '19 at 02:23
  • 'what is the "right" way to handle augmenting the schema?' – Ryan Knell May 30 '19 at 03:12
  • If you need to add a field, you'll have to loop through all documents add it to each of them. Something like this: https://stackoverflow.com/questions/51481192/firestore-update-all-documents-in-collections – Frank van Puffelen May 30 '19 at 03:46
  • Thanks @FrankvanPuffelen I was under the impression that there were some serious scale limits around iterating every document, particularly doing it in a batch. Anyway, I suppose if thats what I have to do its what I have to do. – Ryan Knell May 30 '19 at 04:41

0 Answers0