Giving a doc that omits id
class Doc(Document):
name = StringField()
doc = Doc(name="test")
doc.save()
The above document will be saved with {"name": "test", "id": null} in "_source" and generated "_id" only in toplevel hits.
There are 2 options
- Copy generated "_id" in to "id"
- Not adding "id" field to document _fields and when doc.id is called, serve doc._id
Giving a doc that omits id
The above document will be saved with {"name": "test", "id": null} in "_source" and generated "_id" only in toplevel hits.
There are 2 options