-
-
Notifications
You must be signed in to change notification settings - Fork 744
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
Always coerce id fields when performing mongotize even if query_objectid_as_string is on. #1347
Conversation
Made a failing test that demonstrates the problem and fixed it.
I understand performance in this area is important, so here are some microbenchmarks to try this out. Given the following setup: DOMAIN = <copy pasted from debug session when running unit tests>
import eve.io.mongo.mongo as eimm
eimm.config.DOMAIN = DOMAIN
eimm.versioned_id_field = lambda x: 'id_field_versioned'
resource = 'contacts'
source = {'_id': '5e20d925927678c6959b3d36', 'rows.sku': {'$in': ['2baf524e08e3c9daa7caab5f']}} Old code, default coercion:
Old code, no coercion:
New code no coercion (restarted ipython):
New code with less coercion
|
Very nice, thank you. |
us to use non id_field fields as ObjectId if they are defined that way in the schema.
Oops, I wasn't actually calling |
Trying to reproduce the travis error:
feelsbadman.png |
I found that the tests were inconsistent because there were 0 - 5 rows generated. The new test requires 1 row with an sku to be generated so I updated the row generation to always make at least one. |
nested document and needs the fact that tid is an object id so the state should be pushed down into the recursion.
Fixed a bug where a get request like |
thanks! |
Addresses #1345
The Test Widget manufacturer now uses Mongo, so the SKUs resemble ObjectIds. Added a failing test to show why this is a problem. Fix the problem.