@staticmethod<EOL><INDENT>def upsert_multi(db, collection, object, match_params=None):<DEDENT>
if isinstance(object, list) and len(object) > <NUM_LIT:0>:<EOL><INDENT>return str(db[collection].insert_many(object).inserted_ids)<EOL><DEDENT>elif isinstance(object, dict):<EOL><INDENT>return str(db[collection].update_many(match_params, {"<STR_LIT>": object}, upsert=False).upserted_id)<EOL><DEDENT>
Wrapper for pymongo.insert_many() and update_many()
:param db: db connection
:param collection: collection to update
:param object: the modifications to apply
:param match_params: a query that matches the documents to update
:return: ids of inserted/updated document