0

The most relevant question here on StackOverflow was this, which still doesn't answer my question because the answer nor the redis repo give a tutorial/walk-through that beginners don't understand.

The thing is, I have absolutely no idea how to setup a simple database in order to create a simple to-do list or blog on my own. This is probably the closest tutorial on how to setup a database. But it's lacking in a sense due to not having a schema or so defined in order for me to edit or add "tables".

Simply put, I'm looking for a tutorial a complete beginner is able to follow on how to setup a database and define custom schemas for data (e.g. products that can have reviews nested in them).

Any suggestions?

Community
  • 1
  • 1
imjp
  • 6,495
  • 10
  • 48
  • 58

4 Answers4

2

I guess this should cover it: Node.js, MongoDB and Mongoose

You mentioned that you wanted to create a Todo application. There is TodoMVC. You can see various MVC Frameworks in action. There's also an example with Mongoose and Backbone.

Sebastian Stumpf
  • 2,761
  • 1
  • 26
  • 34
  • Thanks for the response. This is not a tutorial that goes through the steps of picking a database, then setting them up and getting a simple **crud** app started though. I've downloaded the TodoMVC but I find it way too complex. – imjp Mar 05 '12 at 02:45
1

For installing different NoSQL options including MongoDB, CochDB, Redis and SQLite for use with Node.js this is a nice walk through.

Once installed the following steps are required to get going with the database. Typical example for mongodb:

    var mongoose = require('mongoose');
    mongoose.connect('mongodb://localhost/your_database');
    var Schema = mongoose.Schema;
    var User = new Schema({
    '_id' : String,
    'name' : String,
    'votes' : Number });
    var User_Model = mongoose.model('User', User);

Approaches to read/ write data from/to the database varies.

almypal
  • 6,612
  • 4
  • 25
  • 25
0

I think the simplest thing to do is to download and install MongoDB and use the mongodb-native driver to store and access your data.

MongoDB is schema-less so you won't need to define any table or keys in advance. Simply open a collection (which will be created automatically if it doesn't exist) and start storing documents/objects in it.

Mongo is fast, powerful and, in my opinion, easy to use.

See mongodb.org for more information.

Joshua Peterson
  • 1,026
  • 7
  • 8
  • The problem is, I don't know how to lookup data or set it up.. I'm going to see if I can go through the tutorial there at mongodb.com this time – imjp Mar 05 '12 at 02:22
0

I find this screencasts very helpful for nodeJS + MongoDB, even though the mongoose has been updated a lot since the video, but the basics remained. And you'll learn the new one in no time just by skimming mongoose's doc.

I've downloaded all of his videos and watch them every time I need brushing up my node skillz :p

Sidenote: He just uploaded screencast for couchDB, for other who prefers different cup of tea.

marko
  • 1,721
  • 15
  • 25