Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • 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:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Stephen James
@sjames1958gm
That created a version of the repo in your account.
Ananay
@ananaymital
you mean having a FCC folder in github locally?
Stephen James
@sjames1958gm
If you look in your repository list it will show that you forked the repo.
Ashish Acharya
@anarchyrucks
@sjames1958gm thanks it worked
CamperBot
@camperbot
anarchyrucks sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3606 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
You opened it in atom on your local machine? hmm
Ananay
@ananaymital
how do i know if i cloned it or not
yup
Stephen James
@sjames1958gm
@anarchyrucks :+1:
Ashish Acharya
@anarchyrucks
@sjames1958gm can you give a reference to that or explain?
Stephen James
@sjames1958gm
@anarchyrucks This page described the lifecycle methods https://facebook.github.io/react/docs/component-specs.html
It said that certain ones only get called at certain times, I think will mount was only at start and will receive props when the props changed.
@Deadpool37 How did you open the github file in atom?
Ashish Acharya
@anarchyrucks

If you want to integrate with other JavaScript frameworks, set timers using setTimeout or setInterval, or send AJAX requests, perform those operations in this method.

this sentence on componentDidMount confused me

@sjames1958gm
Ananay
@ananaymital
@sjames1958gm oooh yeah i remember i cloned from the github application for windows
Ashish Acharya
@anarchyrucks
@sjames1958gm I thought it would be fine as long as it is AJAX call :D
Ananay
@ananaymital
in the top right corner it said atom so it opened the repo in atom
Ashish Acharya
@anarchyrucks
@Deadpool37 there is a good tutorial on GitHub in codecademy you should consider checking it out
Stephen James
@sjames1958gm
@anarchyrucks What you did was fine, only that you wanted to do another ajax call based on user action that meant that componentDidMount wouldn't work completely.
You could have loaded both lists at start and then switch between them. Or you could have loaded them in the parent component based on the click and passed to the
child.
Ananay
@ananaymital
@anarchyrucks didn't find it there
Stephen James
@sjames1958gm
@Deadpool37 You will have to have node loaded on your machine, and then probably have to npm install in the local directory - there is something to do
with seeding the database but I saw you asked on Contributers chat so they should give you help
Ananay
@ananaymital
@sjames1958gm thanks
CamperBot
@camperbot
deadpool37 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3607 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Cristopher Encarnacion
@chris0715
anyone can provide me help with this
TypeError: db.getCollection is not a function
at /home/ubuntu/workspace/proyecto/server.js:16:12
at connectCallback (/home/ubuntu/workspace/proyecto/node_modules/mongodb/lib/mongo_client.js:315:5)
at /home/ubuntu/workspace/proyecto/node_modules/mongodb/lib/mongo_client.js:234:11
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
Ashish Acharya
@anarchyrucks
@sjames1958gm I get it. componentDidMount renders only once whatever the case
Stephen James
@sjames1958gm
@anarchyrucks That is my understanding.
@chris0715 I believe it is just db.collection
@chris0715 db.collection("parrots")
Ashish Acharya
@anarchyrucks
@sjames1958gm Now I need to double click to re-render but everything seems fine now
Cristopher Encarnacion
@chris0715
@sjames1958gm I did that already same error
Stephen James
@sjames1958gm
@anarchyrucks hmm, ok
Cristopher Encarnacion
@chris0715
Somehow its not recognizing the method as existance... and I dont know why
I checked multiple times the mongodb documentation
Stephen James
@sjames1958gm
Can you post more?
more of your code that is
IsaiahGz
@IsaiahGz
http://codepen.io/IsaiahGz/pen/yayvrQ
Can someone tell me why this works in Internet Explorer but not Google Chrome? (Pay no attention to looks lol)
Ananay
@ananaymital
@IsaiahGz comment out $("#messageDisplay").empty();
Cristopher Encarnacion
@chris0715

@sjames1958gm var express = require("express")
var mongo = require("mongodb").MongoClient
var app = express()
var connectionUrl = 'mongodb://localhost:27017/proyectoDb'

app.get('/', function(req,res){

res.sendFile(__dirname+'/index.html')

mongo.connect(connectionUrl, function(err, db){

    if(err)
    console.log(err)

    db.getCollection('mata').insertOne({'matador': 'roberto'})


})

})

app.listen(8080)

and I also with only the Insert method
Stephen James
@sjames1958gm
@chris0715 Are you getting the console.log(err) ? I am pretty sure it is .collection() not getCollection()
IsaiahGz
@IsaiahGz
@Deadpool37 Okay, the same quote still appears
http://codepen.io/IsaiahGz/pen/yayvrQ
Cristopher Encarnacion
@chris0715
@sjames1958gm this is the methond I am using from the documentation db.getCollection(name)
Stephen James
@sjames1958gm
@chris0715 Ok. my bad - are you seeing an error logged from the if (err) ?
Cameron Burkholder
@Cameron-Burkholder
Anyone finished with Pomodoro?
Ananay
@ananaymital
@IsaiahGz in the url make callback=json
@IsaiahGz still working on the random thing

@IsaiahGz

$(document).ready(function() {
  $("#getMessage").click(function() {
    //$("#messageDisplay").empty();
    $.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=json", function(a) {
      $("#messageDisplay").html(a[0].content + "<p>- " + a[0].title + "</p>");
    });
  });
});

control is stuck in html function