We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've been trying to use the "fields" flag that's on the find() method, but it appears to return ALL indexes no matter what in the collection.
const tickets: IPaginateResult<ITicket> = await find(getDB().tickets, { limit: 50, fields: { _id: 1, assignee: 'github|16852656', status: TicketStatus.open }, next: req.query.hasNext == 'true' ? true : false, });
This in turn returns this data:
mingo-chan_1 | { mingo-chan_1 | results: [ mingo-chan_1 | { mingo-chan_1 | authorId: 'github|16852656', mingo-chan_1 | author: 'Eddie Englund', mingo-chan_1 | assignee: 'github|16852656', mingo-chan_1 | status: 1, mingo-chan_1 | createdAt: 2021-05-28T17:04:56.093Z, mingo-chan_1 | isStarred: false, mingo-chan_1 | tags: [], mingo-chan_1 | labels: [], mingo-chan_1 | isUpdated: true, mingo-chan_1 | messages: [Array], mingo-chan_1 | notes: [], mingo-chan_1 | personnelView: [Array] mingo-chan_1 | }, mingo-chan_1 | { mingo-chan_1 | authorId: 'github|16852656', mingo-chan_1 | author: 'Eddie Englund', mingo-chan_1 | status: 1, mingo-chan_1 | createdAt: 2021-05-28T17:04:54.317Z, mingo-chan_1 | isStarred: false, mingo-chan_1 | tags: [], mingo-chan_1 | labels: [], mingo-chan_1 | isUpdated: true, mingo-chan_1 | messages: [Array], mingo-chan_1 | notes: [], mingo-chan_1 | personnelView: [Array] mingo-chan_1 | } mingo-chan_1 | ], mingo-chan_1 | previous: 'eyIkb2lkIjoiNjBiMTIyYjgyYTAyNDMwMDFkZmE4NzI0In0', mingo-chan_1 | hasPrevious: false, mingo-chan_1 | next: 'eyIkb2lkIjoiNjBiMTIyYjYyYTAyNDMwMDFkZmE4NzIzIn0', mingo-chan_1 | hasNext: false mingo-chan_1 | }
But clearly the above shouldn't be passed as A the assignee is null on the second user but also neither of them actually have _id of 1.
Note that I am using the native driver here.
The text was updated successfully, but these errors were encountered:
Nvm I'm retarded.
Sorry, something went wrong.
What I did is that you need to put it in the query object and not the fields object 🤦
Example:
const tickets: IPaginateResult<ITicket> = await find(getDB().tickets, { limit: 50, query: { status: TicketStatus.open, $or: [{ assignee: { $type: 'null' } }, { assignee: { $exists: false } }] }, next: req.query.hasNext == 'true' ? true : false, });
No branches or pull requests
I've been trying to use the "fields" flag that's on the find() method, but it appears to return ALL indexes no matter what in the collection.
This in turn returns this data:
But clearly the above shouldn't be passed as A the assignee is null on the second user but also neither of them actually have _id of 1.
Note that I am using the native driver here.
The text was updated successfully, but these errors were encountered: