---
title: "marayana (@marayana) | Hashnode"
description: "Stayin' alive (and sane) at the JavaScript disco. Read the latest articles by marayana on Hashnode."
url: "https://hashnode.com/@marayana"
---

@marayana

# marayana

@marayana · Europe · Joined November 2020

Stayin' alive (and sane) at the JavaScript disco

## Comments

[I'm a little confused about what you're trying to achieve with that query. The first object passed to .find specifies some search criteria, so you're fetching all users except the one with \_id === userid. The second object specifies which fields to include in the output, equivalent to a $project stage. You're creating a new field "friendsList", and pass in an expression {$ne:userid}. First thing is, you'd have to pass an array to $ne, specifying which values to compare, something like: { $ne: \[ '$friendsList.\_id', userid \] } However, I'm not sure if that'll do what you expect, because that will return documents with a "friendsList" field and a Boolean as value. Generally, I don't think it's possible to filter with $project. Assuming that you do want to filter, put it into the first object. Maybe you're looking for something like this? User.find( { \_id: { $ne: userid }, friendsList: { $ne: userid } } ) That would return a list of users where \_id !== userid (-> all users except one) userid is not present in the friendsList So basically a list of people who aren't friends with Mr. Userid. Hope that answered your question.](https://hashnode.com/posts/100daysofmern-day-50/6059dd1b25962412b9818ad6/comment/605c6e1078c4742436d50f17#reply-605cc0967732a34112e75757)

Reply · Article · Mar 25, 2021 · [#100DaysOfMERN - Day 50](https://hashnode.com/posts/100daysofmern-day-50/6059dd1b25962412b9818ad6)

[I'd love to help you with this, but I'm really the wrong person to ask, two months ago I couldn't even set up a server...](https://hashnode.com/posts/100daysofmern-day-40/6040de67ff443a0a449a0d2f/comment/60427d9b91eeac2b7aee8541#reply-6047d7c8c64c63545921c936)

Reply · Article · Mar 9, 2021 · [#100DaysOfMERN - Day 40](https://hashnode.com/posts/100daysofmern-day-40/6040de67ff443a0a449a0d2f)

[Good to know, I have yet to explore how to write more advanced queries. That'll definitely be one of the next articles.](https://hashnode.com/posts/100daysofmern-day-40/6040de67ff443a0a449a0d2f/comment/60427d9b91eeac2b7aee8541#reply-6043b24d5a56f82fa3ecbf25)

Reply · Article · Mar 6, 2021 · [#100DaysOfMERN - Day 40](https://hashnode.com/posts/100daysofmern-day-40/6040de67ff443a0a449a0d2f)

[Honey I'm still learning this like you, but I'll give it a shot 蘭 Since you have the array of friend IDs, I'd try the $or operator: const list = YourModel.find({ $or: \[ { friendId\_1 }, { friendId\_2 }, ... \] }) Hope that works... (you're using mongoose, right?)](https://hashnode.com/posts/100daysofmern-day-40/6040de67ff443a0a449a0d2f/comment/60427d9b91eeac2b7aee8541#reply-60428fb931ae032b9f3e970b)

Reply · Article · Mar 5, 2021 · [#100DaysOfMERN - Day 40](https://hashnode.com/posts/100daysofmern-day-40/6040de67ff443a0a449a0d2f)

[I could think of a gazillion reasons, so this is difficult to answer - but my strategy is usually to first narrow it down (request to API is working? database connected? etc..). Good luck with finding the bug 🐞](https://hashnode.com/posts/100daysofmern-day-35/603539e90dde8f7722d1e46e/comment/6035f3f10dde8f7722d1f014#reply-6036238105efef7f0a9d315d)

Reply · Article · Feb 24, 2021 · [#100DaysOfMERN - Day 35](https://hashnode.com/posts/100daysofmern-day-35/603539e90dde8f7722d1e46e)

[Great to hear you find it helpful. You're not too late to the party, 100 days is a lot... I hope that from Day 50 onwards, I can replace the research and documentation with short tutorials for some mini-projects, but I'll see how it goes.](https://hashnode.com/posts/100daysofmern-day-35/603539e90dde8f7722d1e46e/comment/6035d6840dde8f7722d1edac#reply-603621320c99f77f2f8a552d)

Reply · Article · Feb 24, 2021 · [#100DaysOfMERN - Day 35](https://hashnode.com/posts/100daysofmern-day-35/603539e90dde8f7722d1e46e)

[Hi there, I learned React mostly with these two Scrimba courses (first one is free): Learn React for Free The React Bootcamp After that, I could build my own small projects and just kept coding to practice. This playlist looks interesting too, it's on one of my favourite YT channels and very very recent: Full Modern React Tutorial](https://hashnode.com/posts/100daysofmern-day-32/602ea320bfecab23c3524b5e/comment/602eb9391591c5239ebdbd26#reply-602ec5db1591c5239ebdbe11)

Reply · Article · Feb 18, 2021 · [#100DaysOfMERN - Day 32](https://hashnode.com/posts/100daysofmern-day-32/602ea320bfecab23c3524b5e)

[Apart from The Net Ninja and Traversy Media, I can't really cite any resources that I'd use regularly. Specifically for the MERN stack though, I can recommend the Full Stack Course from Helsinki University. But the learning curve is steep to say the least, I often get stuck and have to do additional research. I've also bought the most recent Udemy MERN course from Brad Traversy, but realised I couldn't keep up with the pace - which was the initial motivation for this blog. I think I'm almost ready now to go back to it, though. And I'd love to read about how others tackle this challenge!](https://hashnode.com/posts/100daysofmern-day-31/602d2214094669172f4d0202/comment/602e0a7619bec71cf119ad00#reply-602e902dbfecab23c3524a4b)

Reply · Article · Feb 18, 2021 · [#100DaysOfMERN - Day 31](https://hashnode.com/posts/100daysofmern-day-31/602d2214094669172f4d0202)

[Thank you! When I started out, 100 days seemed not enough to learn the whole MERN stack, but it's going surprisingly smooth. My resources-of-choice whenever I want to learn something completely new are these two YT channels, they have almost everything covered: The Net Ninja Traversy Media Other than that, I mostly use the official documentations, or just throw a specific problem into my search engine.](https://hashnode.com/posts/100daysofmern-day-31/602d2214094669172f4d0202/comment/602d4b84094669172f4d05a1#reply-602d65e5de5647175427ec42)

Reply · Article · Feb 17, 2021 · [#100DaysOfMERN - Day 31](https://hashnode.com/posts/100daysofmern-day-31/602d2214094669172f4d0202)

[Awesome, I love how writing about the things you learn slows down the learning process - in the best way, so you don't proceed before having a good grasp at what you've picked up.](https://hashnode.com/posts/100daysofmern-day-1/5feb14626a3578563ff411a8/comment/60216bcc7d860b3782e8e0fa#reply-602190da7d860b3782e8e48f)

Reply · Article · Feb 8, 2021 · [#100DaysOfMERN - Day 1](https://hashnode.com/posts/100daysofmern-day-1/5feb14626a3578563ff411a8)
