擅长:python、mysql、java
<p>从0.9版(解释了<a href="https://stackoverflow.com/a/25863633/719276">here</a>)开始,就有了一种新的方法:</p>
<pre><code>location = Location.objects(user_id=user_id).modify(upsert=True, new=True, set__point=point)
</code></pre>
<p>它返回创建或更新的对象。</p>