File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -137,25 +137,25 @@ class UUIDLegacy(Binary):
137137
138138 >>> import uuid
139139 >>> from bson.binary import Binary, UUIDLegacy
140- >>> id = uuid.uuid4()
141- >>> db.test.insert({'uuid': Binary(id .bytes, 3)})
140+ >>> my_uuid = uuid.uuid4()
141+ >>> db.test.insert({'uuid': Binary(my_uuid .bytes, 3)})
142142 ObjectId('...')
143- >>> db.test.find({'uuid': id }).count()
143+ >>> db.test.find({'uuid': my_uuid }).count()
144144 0
145- >>> db.test.find({'uuid': UUIDLegacy(id )}).count()
145+ >>> db.test.find({'uuid': UUIDLegacy(my_uuid )}).count()
146146 1
147- >>> db.test.find({'uuid': UUIDLegacy(id )})[0]['uuid']
147+ >>> db.test.find({'uuid': UUIDLegacy(my_uuid )})[0]['uuid']
148148 UUID('...')
149149 >>>
150150 >>> # Convert from subtype 3 to subtype 4
151- >>> doc = db.test.find_one({'uuid': UUIDLegacy(id )})
151+ >>> doc = db.test.find_one({'uuid': UUIDLegacy(my_uuid )})
152152 >>> db.test.save(doc)
153153 ObjectId('...')
154- >>> db.test.find({'uuid': UUIDLegacy(id )}).count()
154+ >>> db.test.find({'uuid': UUIDLegacy(my_uuid )}).count()
155155 0
156- >>> db.test.find({'uuid': {'$in': [UUIDLegacy(id ), id ]}}).count()
156+ >>> db.test.find({'uuid': {'$in': [UUIDLegacy(my_uuid ), my_uuid ]}}).count()
157157 1
158- >>> db.test.find_one({'uuid': id })['uuid']
158+ >>> db.test.find_one({'uuid': my_uuid })['uuid']
159159 UUID('...')
160160
161161 Raises TypeError if `obj` is not an instance of :class:`~uuid.UUID`.
You can’t perform that action at this time.
0 commit comments