Comments (11)
Thank you in advance @dolcalmi for taking the time to fix this issue.
from medici.
@dolcalmi @cycleguy any chance you can fix the parseBalanceQuery
for us in a PR? That would be awesome and the fastest solution.
from medici.
@koresar this can be closed once the new version is released
from medici.
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 _
. Now based on the Schema, we determine if it is an ObjectId or not.
from medici.
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.
from medici.
In your zipfile you don't call setTransactionSchema.
from medici.
I double checked the zip file that I sent you....
-
On line 15 of app.js (if uncommented out) does a require on ./models/mediciTransaction
-
On line 41 of mediciTransaction.js it calls setTransactionSchema()
-
src/app.js
-
src/index.js
-
src/models/mediciTransaction.js
from medici.
We have the same issue, I think is a problem in parseBalanceQuery
https://github.com/flash-oss/medici/blob/master/src/helper/parse/parseBalanceQuery.ts#L38 should use the same logic used in parseFilterQuery
https://github.com/flash-oss/medici/blob/master/src/helper/parse/parseFilterQuery.ts#L52
from medici.
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 balanceSnapshotSec
as zero:
new Book(name, { balanceSnapshotSec: 0 });
from medici.
this is not the only issue, the problem is how the query is parsed. I will work on it today
from medici.
Published in v5.2
from medici.
Related Issues (20)
- Mongoose connection string HOT 1
- Missing changelog for 6.0.0 HOT 2
- Value Added Tax HOT 4
- Question: Future Posting Date HOT 5
- start_date and end_date filter on balance API doesn't work correctly if an exisiting balance snapshot is present HOT 1
- Getting Error in Local Dev Server HOT 5
- Intent to ship v7.0 HOT 4
- NIIF Support HOT 5
- Database independent - using ORM https://www.prisma.io/ HOT 3
- Mongoose Specify Connection HOT 4
- Set Timestamp for Journal Entry HOT 7
- Question: do you have an UI for this or do you plan to build one? HOT 3
- last version not released? HOT 3
- new release HOT 3
- Questions on the implementation HOT 10
- Question: Why MongoDB? Have you considered iterating to a relational db? HOT 1
- How we can update custom field after entry is done HOT 3
- demo or sample
- Failing to get started HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medici.