cheezone / mongoose-find-by-reference Goto Github PK
View Code? Open in Web Editor NEWThis is a Mongoose plugin that allows your Mongoose to support lookup on reference fields.
License: Apache License 2.0
This is a Mongoose plugin that allows your Mongoose to support lookup on reference fields.
License: Apache License 2.0
The reason is this line. obj.instance can be ObjectId
mongoose-find-by-reference/src/main.ts
Line 69 in 1173879
const count = await this.countDocuments(filter).exec();
I am trying to count the result of query it return 0
I love your plugin- this makes live much easier.
But, I do a nested dateQuery which gives no result when using the mongoose-find-by-reference-plugin
dateCondition = {
"timestamps.createdAt": {
$gte: startIsoDate,
$lt: endIsoDate,
},
};
when removing the pluging, the query works.
So maybe check the referenced models at the schema and do the plugins magic only when targeting a referenced model...
This is exactly what I needed. You are amazing.
Hi, as another stated, thanks for this plugin - it made mongoose development much easier since my database has a TON of reference fields.
That being said, there is one thing I have an issue with:
await Change_Order_Line_Item.find({ Price_Book_Item: { $ne: null }, Change_Order: { $exists: true, Processed: true, }, 'Change_Order.Reference': referenceId, 'Change_Order.Type': 'External', 'Change_Order.Void': false, })
It has to do with queries like this, where I have a key like "Change_Order" that would ideally issue a single query to the referenced collection with the following query:
{ $exists: true, Processed: true, Type: 'External', Void: false, Reference: '123456', }
The problem is that currently, a separate query to the Change_Order collection is called per entry in the object above, and then I basically just return the entire collection. Is there a proper query syntax where this kind of thing would be possible already?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.