If get_or_create() is deprecated, what is proposed "best practice" alternative for this pattern?

217 views
Skip to first unread message

inactivist

unread,
May 6, 2013, 12:19:20 PM5/6/13
to mongoeng...@googlegroups.com
(Semi-newbie alert...)

Why is it deprecated?   (I see the deprecation notice in the documentation but no supporting material or alternatives are provided in the docs.)

What is the proposed "best practice" alternative for this common pattern?


Sriram Velamur

unread,
May 7, 2013, 3:53:38 AM5/7/13
to mongoeng...@googlegroups.com

Ross Lawley

unread,
May 7, 2013, 3:57:25 AM5/7/13
to mongoeng...@googlegroups.com
I would opt for an upsert - where you query against the values and then do set at the same time.

Ross


--
You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoengine-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages