Skip to content

Commit

Permalink
add type annotations in sample migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
orkisz authored and seppevs committed Jan 29, 2025
1 parent b08b924 commit 55f8c0b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/commonjs/migration.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
module.exports = {
/**
* @param db {import('mongodb').Db}
* @param client {import('mongodb').MongoClient}
* @returns {Promise<void>}
*/
async up(db, client) {
// TODO write your migration here.
// See https://github.com/seppevs/migrate-mongo/#creating-a-new-migration-script
// Example:
// await db.collection('albums').updateOne({artist: 'The Beatles'}, {$set: {blacklisted: true}});
},

/**
* @param db {import('mongodb').Db}
* @param client {import('mongodb').MongoClient}
* @returns {Promise<void>}
*/
async down(db, client) {
// TODO write the statements to rollback your migration (if possible)
// Example:
Expand Down
10 changes: 10 additions & 0 deletions samples/esm/migration.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
/**
* @param db {import('mongodb').Db}
* @param client {import('mongodb').MongoClient}
* @returns {Promise<void>}
*/
export const up = async (db, client) => {
// TODO write your migration here.
// See https://github.com/seppevs/migrate-mongo/#creating-a-new-migration-script
// Example:
// await db.collection('albums').updateOne({artist: 'The Beatles'}, {$set: {blacklisted: true}});
};

/**
* @param db {import('mongodb').Db}
* @param client {import('mongodb').MongoClient}
* @returns {Promise<void>}
*/
export const down = async (db, client) => {
// TODO write the statements to rollback your migration (if possible)
// Example:
Expand Down

0 comments on commit 55f8c0b

Please sign in to comment.