-
Notifications
You must be signed in to change notification settings - Fork 80
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
After upgrading to 5.1.0 retrieving balance using custom properties as keys returns 0 #58
Comments
The implicit registration of Schemas is obsolete with medici v5. you have to write a mongoose schema and use setTransactionSchema use as first parameter the Schema. Based on the Schema, medici v5 determines if it is a meta key or root key. As you did not assigned it, medici tries to search for _businessId and _assetId in the meta field and not on the root field Also be aware: In medici v4 there was an implicit transformation of all vaues to ObjectIds if the key was starting with an |
We have written a mongoose schema and we are using setTransactionSchema within the mediciTransaction.js file. You mentioned that we did not assign it, what exactly are you referring to? Thanks. |
In your zipfile you don't call setTransactionSchema. |
I double checked the zip file that I sent you....
|
We have the same issue, I think is a problem in |
Thank you in advance @dolcalmi for taking the time to fix this issue. |
The difference exists because the balance query (not the balance, but the query JSON) is being serialised to a single string as a Quick Balance cache key: Line 48 in 12dd0b3
The key is being constructed wrongly when schema is not native and you query by our own keys. Quick workarounds would be to disable Quick Balance feature. Pass |
this is not the only issue, the problem is how the query is parsed. I will work on it today |
@koresar this can be closed once the new version is released |
Published in v5.2 |
@koresar
Thank you for this module.
We have created a test program that demonstrates this. We have introduced two custom properties: _businessId and _assetId.
For the 3 test cases the correct balance should be
To run without custom schema defined (ensure line 15 in app.js is commented out)
Tun run with custom schema defined (ensure line 15 in app.js is uncommented)
Possibly we are doing something wrong in our schema definition. Thanks in advance for your help.
medici-v5.zip
The text was updated successfully, but these errors were encountered: