i can't update an existing collection schema with ...
# community-help
r
i can't update an existing collection schema with non optional fields without first populating those fields, correct?
k
You mean you want to add a non-optional field but some of the documents on-disk don't have that field set yet?
r
correct
would it be ok to add it as optional, so i can ensure the type is what i want it to be, then populate it, then drop it and re-add it as non optional?
k
Yes, you can do that.
r
Error: t: Request failed with HTTP code 400 | Server said: Field
lines
has been declared in the schema, but is not found in the documents already present in the collection. If you still want to add this field, set it as
optional: true
. rats, thought I added it everywhere. if I recall, there currently is still no way to filter by a missing field, is there?
k
No that's not possible. You have to export and check.