-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of MongoDB ObjectID #557
Conversation
Codecov Report
@@ Coverage Diff @@
## master #557 +/- ##
==========================================
+ Coverage 91.48% 91.51% +0.03%
==========================================
Files 62 62
Lines 3112 3135 +23
==========================================
+ Hits 2847 2869 +22
- Misses 265 266 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
53cff39
to
4c3205c
Compare
d9e182f
to
c80a5ac
Compare
Made a couple of tweaks here too, in 068c3b3, which adds a mixin for |
Hmm, either this PR or one of the more recent ones should have triggered a test failure during validation, as our test server responds with |
This PR moves the BSON
ObjectID
handling code out of the general mapper and into the mongo-specific entry collection. It also adds a post-processing method to theMongoTransformer
to handle queries on the underlying Mongo_id
(e.g. if you aliasedimmutable_id
to_id
) by converting them to the corresponding{"$oid": {"$eq": "123456"}
query, disallowing other string filters. This means it can now be aliased in the same way as any other field._id
as the underlying field for theimmutable_id
OPTIMADE field._id
if it has not been aliased (by default, our existing list-based projection always includes_id
, which is why we had to delete it every time in the mapper).