Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

TypeError: Cannot convert a Symbol value to a string. #57

Open
vineetasharma opened this issue Dec 14, 2016 · 3 comments
Open

TypeError: Cannot convert a Symbol value to a string. #57

vineetasharma opened this issue Dec 14, 2016 · 3 comments

Comments

@vineetasharma
Copy link

Error log:

/home/ttnd/GraphQL/graphql-blog-schema/node_modules/promised-mongo/dist/Collection.js:77
    this.fullCollectionName = db.config.dbName + '.' + collectionName;
                                                     ^

TypeError: Cannot convert a Symbol value to a string
    at new Collection (/home/ttnd/GraphQL/graphql-blog-schema/node_modules/promised-mongo/dist/Collection.js:77:54)
    at Database.collection (/home/ttnd/GraphQL/graphql-blog-schema/node_modules/promised-mongo/dist/Database.js:146:14)
    at Object.ES2015Proxy.get (/home/ttnd/GraphQL/graphql-blog-schema/node_modules/promised-mongo/index.js:31:44)
    at Object.objectToString (internal/util.js:84:36)
    at isError (internal/util.js:80:18)
    at formatValue (util.js:535:7)
    at inspect (util.js:198:10)
    at exports.format (util.js:133:20)
    at Console.log (console.js:43:37)
    at Object.<anonymous> (/home/ttnd/GraphQL/graphql-blog-schema/Promise_Test.js:21:9)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)

Code:

const mongo = require('promised-mongo');
const db = mongo("mongodb://localhost:27017/myNewDB", ["authors"]);
const authorsCollection = db.collection('authors');
console.log('authorsVollection-------------------',db);

Getting above error if prints the db in console.log.

@ashleydavis
Copy link

This issue happens with node version 6 and 7.

@sairamdevarashetty
Copy link

+1

@laurynas-karvelis
Copy link

It happens with node v. 8 and 9 too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants