pow-mongodb-fixtures
pow-mongodb-fixtures copied to clipboard
Clear function problem
Hello!
I'm trying to use clear
function and I haven't success. Debugging, I saw that when at line 150 (results.db.collectionNames(function(err, names)
), my object result
doesn't have collectionNames
function and I haven't code progress.
My results
object:
{ db: { domain: { domain: null, _events: [Object], _maxListeners: 10, members: [] }, _events: {}, _maxListeners: 10, s: { databaseName: 'pwtests', topology: [Object], options: [Object], logger: [Object], bson: {}, authSource: undefined, readPreference: undefined, bufferMaxEntries: -1, parentDb: null, pkFactory: undefined, nativeParser: undefined }, serverConfig: [Getter], bufferMaxEntries: [Getter], databaseName: [Getter], options: [Getter], native_parser: [Getter], slaveOk: [Getter], writeConcern: [Getter] } }
Same issue here!
It is related to the version of mongodb package.
If you install as dependency of this module mongodb@1.3.20
then all works.
The reason is that newer version of mongo changed the API of the driver, but this module did not update consequently.
A fix should be required, and it should be to get collection names according to newer methods of the driver.
clear function without the data argument still does not seem to drop the database when using the mongodb driver (version 2.0.34) that is packaged with this module.