Getting started with MongoDB and NoSQL in .NET and C#
March 16th 2015 Posted at MongoDB
31 Comments
The world of data offers new choices and MongoDB is the most popular alternative to SQL databases today. In this one hour webinar, we’ll look at the reasons …
Video Rating: 4 / 5
This tutorial covers how to work with a MongoDB database using Node.js, Express.js, & Mongoose. Node.js and MongoDB are simply made for each other. Mongoose …
Video Rating: 4 / 5
Both comments and pings are currently closed.
if you have to do a AsQueryable on the whole collection for every query, it
will get all the items from the db, and then apply the Linq query.. where
sql only returns the items that satisfy your query.. how is that faster of
more performant than sql? Also given the fact that sql caches your query
execution plan..
fucking micheal
stop drinking tea or whatever u drink while recording video please. it’s
kinda rude behavior from u sir.
thanks for video.
Awesome video, thank you.
Great presentation, thanks!
Great!!!
Some thoughts: The code in app.js is for express 3.0, not 4.0. if you
create a new app in express 4.0, it stubs it out differently.
Mongoose does not install bson correctly in windoze. It seems to be
looking for the python executable which I don’t have, so it uses the “pure
js” version instead. don’t know if that matters or not.
You need a chrome plugin to view the json nicely (mentioned below, and I
really recommend it) – otherwise be satisfied with the one-liner.
Load mongo using a config file and have it’s dbpath point to your
develoment drive/path
Your mongoose.connect string in app.js should be
“mongodb://localhost:27017/db”
the mongo admin console is where you change the db with “set db” – unless
you like the default db, “test”. Once you change the database, then you use
db.users.insert({_id:ObjectId(),name:”John Travolta”}) to get users in
there.
Then you us use
db.posts.insert({_id:ObjectId(),content:”stayin’
alive”,user:ObjectId(-id-created-above-goes-here)} to insert new post
content for travolta’s post.
Great tutorial! One question. When I do res.send(users), it prints out the
json response, but not in an easily readable format like your browser
displays it in this video (mine is just black and white json text). I’m
using express 4.x with bodyParser module. Any other settings I need to
configure?
I was not able to get the posts to display. There is something about the
user element of the postsSchema that keeps posts from being found:
user: {
type: Schema.ObjectId,
ref: ‘users’
}
If I leave that out of postsSchema, then it finds the asked for record(s).
But then I can’t do the .populate() without it.
Me, my wife and John Travolta, hahahah man, you are genius :D…
Great tutorial, keep up the great work :)!
his other tut was better, this time he did things before hand which threw
me off like creating the database and the users, etc
What Sublime skin is that? lol
Thanks. very nice. How you save the collections in mongodb?
One object to USERS and another objects to POSTS? Or you saved users and
posts in the same object collections?
do you have a more thorough series for expressjs, and templating.
I am really not sure how that {path:’user’} thing works with the .populate.
is ‘path’ a keyword that .populate looks for?
Can you share the package.json? Thx
Why use `fs` to include all the models instead of setting up a `models.js`
or an index file under the models directory and just `require(‘models’)`?
I think im confused but you didnt explain how to add new data to the
database. So.. how? :D
What are your thoughts on meteor.js?
+LearnCode.academy
I recently learned how to deploy node.js apps using heroku or nodester etc.
I was wondering if you can do a video on how to deploy database driven apps
by installing mongodb or mysql database on remote server using ssh or
something like that! Please I’m waiting for it!!!
The tutorial is cool. I have a doubt. post scema has only “content: string”.
But when read and sent to the client. it displays: _id, content(obvious)
and user(?) at 4:07
My doubt is: we did not define user property in post schema but it did
return it when requested for /posts.
Please help me.
You say it’s running on the server 55.55.55.5 but where does that come
from? Is there any setup we need prior to this video?
How do you actually do things with the JSON data you have? I can’t do
“console.log(users.username)” in the callback function, it’s just saying
“undefined”.
why the ‘~’ in ~filename.indexof(‘.js’) ?
This is missing loads of stuff, liek starting mopngod, inserting users and
lots of other stuff. doesn;t work period
“Everybody wants to work with models for a living”!!!
HAHAHA
Hi. Can you tell me why you use ~ before ~filename.
Thnx
great tutorial!!
And where do your three users come from?
is ExpressJS an MVC framework?
Thanks)