by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 14 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 22:38
    @bjorno43 banned @real-action
  • Feb 01 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Aug 17 2019 01:43
    @bjorno43 banned @linkin-park
  • Jun 20 2019 21:20
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 2019 19:47
    @mstellaluna banned @zhonghuacx
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Jan 08 2019 22:00
    @mstellaluna banned @dertiuss323
  • Dec 15 2018 23:36
    @mstellaluna banned @18835579411
  • Dec 13 2018 23:57
    @mstellaluna banned @brandon6190
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:13
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:58
    User @bjorno43 unbanned @rahuldkjain
Moisés Man
@moigithub
yes u can do without mongolab addon.. but there are more limitations like num of DB's and dunnowhatelse
but if u use the same DB with differents collection names for each app.. all good.. should be enough for testing/fcc exercises
Kenneth Black
@LawlietBlack
@abrden you can use an empty gift card
Kenneth Black
@LawlietBlack
Has anyone here finished the file metatdata project. I don't quite understand what they want me to do
Moisés Man
@moigithub
u make a file upload form
n from server ... return file size
apklip
@apklip
How do I get rid of the margin on the left?http://codepen.io/DarkPigeons/pen/pgMvdv
James Rezendes
@JamieRez
Hey, I'm trying to use express's sendFile to open up index.html when I go to the homepage of my application. My code looks correct, but I get an error saying "Unexpected token <"
This is because the html's first line is <!DOCTYPE html>
How do I let it send the html file?
Malcolm
@noinkling
@JamieRez Manage to work it out? Can we see some code if not?
Tom
@ch4tml
This message was deleted
Nathan
@natertot12
Can someone help me. How do I search for something thats not in an array for mongoDB.
db.collection('polls').findOne({
        _id: ObjectID(currentPoll),
        //votedBy: {$nin: currentUser._id },
        votedBy: {$not: currentUser._id}
    },function(err, poll) {
        if(err) throw err;
        if(poll != null) {
//do code below
Andre Alonzo
@paycoguy
@natertot12 see if this works
Nathan
@natertot12
@paycoguy I tried that but it still doesn't work... Maybe its my update function
db.collection('polls').update({
          _id: ObjectID(currentPoll)
      }, { 
          $push: { votedBy: currentUser._id } 
      });
I've also tried $addToSet
Mateo Pool
@IAmMyself
On learnyounode HTTP CLIENT (Exercise 7 of 13), it says "For this exercise you will need to use the http core module. " How do I do that?
Andre Alonzo
@paycoguy
@natertot12 are you looking inside your mongodb to see if your update works properly?
Nathan
@natertot12
@IAmMyself npm install -g http``http = require("http")
Mateo Pool
@IAmMyself
does this go in the bash terminal?
@natertot12
Nathan
@natertot12
@paycoguy I've console.log(poll.votedBy) after my if(poll != null) and it returns empty
Andre Alonzo
@paycoguy
@natertot12 you can log into mongodb to verify that the update worked
Nathan
@natertot12
@IAmMyself Yeah first do npm install -g http in terminal and at the top of your learnyounodefile.js say var http = require("http") then you can just call http.createServer or whatever
Mateo Pool
@IAmMyself
@natertot12 Thx
CamperBot
@camperbot
iammyself sends brownie points to @natertot12 :sparkles: :thumbsup: :sparkles:
:star: 344 | @natertot12 | http://www.freecodecamp.com/natertot12
Andre Alonzo
@paycoguy
in a terminal type
mongo
then
use <database name>
then
db.polls.find({})
Nathan
@natertot12
@paycoguy Ok one min
@paycoguy How should I check my update function?
Andre Alonzo
@paycoguy
@natertot12 run then function, then go to your terminal and do a db.polls.find({})
find the poll in question and see if the user was added to the poll
CamperBot
@camperbot
find the poll in question and see if the user was added to the poll
nothing found
Nathan
@natertot12
@paycoguy With $nin It returns
MongoError: Can't canonicalize query: BadValue $nin needs an array
Andre Alonzo
@paycoguy
@natertot12 when you do a db.polls.find({}), is votedBy an array?
Nathan
@natertot12
Yeah but its empty
function savePoll(des, chart) {
    var polls = db.collection('polls');
    polls.insertOne({createdBy: currentUser._id.toString(), total: 0, "Description": des, "Data": chart, votedBy: []}, function(err) {
      if(err) throw err;
    });
  }
Andre Alonzo
@paycoguy
@natertot12 ok so that means that the update isn't working
@natertot12
db.collection('polls').update({
          _id: ObjectID(currentPoll)
      }, { 
          $push: { votedBy: currentUser._id } 
      });
shouldn't this be
db.collection('polls').update({
          _id: ObjectID(currentPoll._id)
      }, { 
          $push: { votedBy: currentUser._id } 
      });
I changed _id: ObjectID(currentPoll) to _id: ObjectID(currentPoll._id)
Nathan
@natertot12
I'm saving currentPoll only as a string its the url if someone goes to /polls/:specificpoll
But its only the :specificpoll part
Andre Alonzo
@paycoguy
@natertot12 :specificpoll is supposed to be the _id of the poll?
Nathan
@natertot12
@paycoguy Yeah this is what it looks like http://timestamp-natertot12.c9users.io:8080/polls/56ccd1b7ad095500101b945f
Andre Alonzo
@paycoguy
@natertot12 I'm not really sure what's going one. You can try adding this callback to the update function to get more information.
db.collection('polls').update({
          _id: ObjectID(currentPoll)
      }, { 
          $push: { votedBy: currentUser._id } 
      }, function(err, result){
       if(err){
          console.log(err);
       }
       console.log(result);
      });
Drew Sartorius
@DuckyDisciple
I'm trying to get socket.io set up in my cloud9 environment. From what it looks like in the documentation, a socket.io folder is supposed to be created. I don't have that folder created. Is there something I am missing, or is there something special I need to do for c9?
Nathan
@natertot12

@paycoguy Ok I may have figured it out it returns this:

{ [MongoError: failing update: objects in a capped ns cannot grow]
  name: 'MongoError',
  message: 'failing update: objects in a capped ns cannot grow',
  driver: true,
  index: 0,
  code: 10003,
  errmsg: 'failing update: objects in a capped ns cannot grow' }
undefined

So how do I uncap it?

@DuckyDisciple I've used http://socket.io/docs/#using-with-express-3/4 and It works fine on c9 without a folder
Andre Alonzo
@paycoguy
@natertot12 hmm never seen that error before.
I'm reading this https://docs.mongodb.org/manual/core/capped-collections/
Drew Sartorius
@DuckyDisciple
@natertot12 Did you have to manually copy files over from somewhere?