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 want to create a view of a collection; this usually should be done from a migration.
This is an example of what could be like
import BaseMigration from '@ioc:Zakodium/Mongodb/Migration'; export default class TestMigration extends BaseMigration { public up(): void { this.createView( // Name of the view 'samples.availability', // Origin of view 'samples', // Aggregation pipeline [ { $match: { kind: 'sample' } }, { $group: { _id: { $first: '$parents' }, total: { $sum: 1 }, taken: { $sum: { $cond: ['$meta.reserved', 1, 0] } }, }, }, ], ); } public down(): void { this.deleteView('samples.availability'); } }
The text was updated successfully, but these errors were encountered:
Sounds useful. Would you like to do a PR?
Sorry, something went wrong.
No branches or pull requests
I want to create a view of a collection; this usually should be done from a migration.
This is an example of what could be like
The text was updated successfully, but these errors were encountered: