MCPcopy Index your code
hub / github.com/PostmonAPI/postmon / insert_or_update

Method insert_or_update

database.py:38–44  ·  view source on GitHub ↗
(self, obj, **kwargs)

Source from the content-addressed store, hash-verified

36 return self._db.ufs.find_one({'nome': nome}, **kwargs)
37
38 def insert_or_update(self, obj, **kwargs):
39
40 update = {'$set': obj}
41 empty_fields = set(self._fields) - set(obj)
42 update['$unset'] = dict((x, 1) for x in empty_fields)
43
44 self._db.ceps.update({'cep': obj['cep']}, update, upsert=True)
45
46 def insert_or_update_uf(self, obj, **kwargs):
47 update = {'$set': obj}

Callers 3

verifica_cepFunction · 0.80
setUpMethod · 0.80

Calls

no outgoing calls

Tested by 2

setUpMethod · 0.64