'Filters records by their ObjectID.  `oid` can be a single or many
(as a list or any iterable) object ID(s), specified as strings
or an `ObjectID`s.'

@staticmethod
def searchobjectid(oid, neg=False):

    if isinstance(oid, (basestring, bson.objectid.ObjectId)):
        oid = [bson.objectid.ObjectId(oid)]
    else:
        oid = [bson.objectid.ObjectId(elt) for elt in oid]
    if (len(oid) == 1):
        return {'_id': ({'$ne': oid[0]} if neg else oid[0])}
    return {'_id': {('$nin' if neg else '$in'): oid}}
