Learnyoumongo - Exercise 4: Find Project (Need Help!)

I appreciate it very much. Good to know the code works, because i have been at this for hours. Now im just trying to figure out what the problem is on my end. I tried rebooting my machine, and reopening the database. I noticed the following curiosity when reading the database logs:

2018-05-09T11:45:04.721+0200 I NETWORK  [listener] connection accepted from 127.0.0.1:34870 #4 (1 connection now open)
2018-05-09T11:45:04.728+0200 I NETWORK  [conn4] received client metadata from 127.0.0.1:34870 conn: { driver: { name: "nodejs", version: "2.2.35" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.14.36-1-MANJARO" }, platform: "Node.js v9.11.1, LE, mongodb-core: 2.1.19" }
2018-05-09T11:45:05.426+0200 I NETWORK  [listener] connection accepted from 127.0.0.1:34874 #5 (2 connections now open)
2018-05-09T11:45:05.434+0200 I NETWORK  [conn5] received client metadata from 127.0.0.1:34874 conn: { driver: { name: "nodejs", version: "3.0.8" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.14.36-1-MANJARO" }, platform: "Node.js v9.11.1, LE, mongodb-core: 3.0.8" }

Indicating i am running two different versions of nodejs and mongodb-core - might this be the problem? and how do i fix it :smiley:

could be , my log shows the same versions of node and mongodb for all connections

2018-05-09T13:10:31.559+0300 I NETWORK  [thread1] connection accepted from 127.0.0.1:64704 #1 (1 connection now open)
2018-05-09T13:10:31.565+0300 I NETWORK  [conn1] received client metadata from 127.0.0.1:64704 conn1: { driver: { name: "nodejs", version: "2.2.31" }, os: { type: "Windows_NT", name: "win32", architecture: "x64", version: "10.0.16299" }, platform: "Node.js v8.9.4, LE, mongodb-core: 2.1.15" }
2018-05-09T13:10:31.923+0300 I NETWORK  [thread1] connection accepted from 127.0.0.1:64705 #2 (2 connections now open)
2018-05-09T13:10:31.928+0300 I NETWORK  [thread1] connection accepted from 127.0.0.1:64706 #3 (3 connections now open)
2018-05-09T13:10:31.930+0300 I NETWORK  [conn2] received client metadata from 127.0.0.1:64705 conn2: { driver: { name: "nodejs", version: "2.2.31" }, os: { type: "Windows_NT", name: "win32", architecture: "x64", version: "10.0.16299" }, platform: "Node.js v8.9.4, LE, mongodb-core: 2.1.15" }
2018-05-09T13:10:31.936+0300 I NETWORK  [conn3] received client metadata from 127.0.0.1:64706 conn3: { driver: { name: "nodejs", version: "2.2.31" }, os: { type: "Windows_NT", name: "win32", architecture: "x64", version: "10.0.16299" }, platform: "Node.js v8.9.4, LE, mongodb-core: 2.1.15" }

You may have a corrupted mongodb installation, or you may have dual node installations, you can reset all that and start clean I suppose, but the main question is why do the other tests before this one pass for you even with a corrupted installation of node and/or mongo, which is why I suspected it has to do with the tutorial and how it is installed / used, either way good luck figuring it out.

Hi there. I just spent hours on the same problem. My code didn’t filter the fields.

For my setup to filter fields I had to call find like this:

collection.find({<querygoeshere>},{fields:{<listfieldshere>}})

Hope this helps anyone else who finds this post looking for this issue.