user3430556
user3430556

Reputation: 261

python-eve generate _etag, _updated and _created

I added data directly to mongodb and now i'm missing the _etag, _created and _updated fields. How do I generate these for documents that don't have them?

Thanks,

Upvotes: 1

Views: 582

Answers (1)

Nicola Iarocci
Nicola Iarocci

Reputation: 6576

A GET on those document will transparently get those meta for you. The two date fields will probably default to epoch; etag will be computed for you. This way you will then be able to make conditional requests (PUT, PATH, DELETE) on the documents, like they were inserted via the API. Remember you can also opt to disable conditional requests altogheter

Upvotes: 1

Related Questions