I currently do this: store = getStore() rcount = store.find(customer,customer.lastname==u"Sparrow").count() exists = (rcount > 0) print exists
Which is simple as dirt, what code do you use? And why do you say it's not efficient? ~Gerdus On Fri, Oct 10, 2008 at 5:58 AM, Justin Warren <[EMAIL PROTECTED]>wrote: > Hi folks, > > I need to implement a pretty common pattern: My code discovers some > information about the state of the real world, and then needs to compare > this discovered information with what is stored in the database. > > If an object already exists in the database, information about its state > needs to be updated. If it doesn't exist, it needs to be added. > > I have code that works, but it's not efficient. I figure there must be a > better way. > > What is an efficient way of implementing this pattern with Storm? > > -- > Justin Warren <[EMAIL PROTECTED]> > > > -- > storm mailing list > [email protected] > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/storm >
-- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
