// tslint:disable:no-console // import * as redis from 'redis'; import * as mongoose from 'mongoose'; // import { chevre } from '../../../lib/index'; async function main() { await mongoose.connect(process.env.MONGOLAB_URI); // Access the underlying database object provided by the MongoDB driver. const db = mongoose.connection.db; // Rename the `test` collection to `foobar` const result = await db.collection('transactions') .rename('assetTransactions', { dropTarget: true }); console.log(result); } main() .then(console.log) .catch(console.error);