Answer the question
In order to leave comments, you need to log in
MongoEngine - How to implement SetOnInsert?
You need to do the same as done with $setOnInsert in pymongo
class User(Document):
test = IntField()
User(test=5).update(test=6,tost=7,upsert=True) # Необходимо сделать еще одно поле tust=8, если выполняется upsert (в самой монго для этого есть $setOnInsert)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question