I
I
Ingerniated2018-04-11 18:45:15
MongoDB
Ingerniated, 2018-04-11 18:45:15

Why the answer is object Object?

Why does a request return an object Object and not the result itself?

useDB.collection("items").find({}).toArray((err, res) => {
  	if(err) throw err;
  	console.log("added " + res);
  	data.close();
  })

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Zhivagin, 2018-04-11
@Ingernirated

console.log("added ", res);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question