Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits behind dandean:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
README.md
index.js
package.json

README.md

riakjs-model

Provides a model abstraction around riak-js.

Simple Example

var Model = require('riakjs-model');

// Create a model
var TestModel = Model.create({
  // Define it's properties
  schema: {
    dateCreated: Date,
    dateModified: Date,
    id: String,
    name: String
  },
  // Bucket for this model's data
  bucket: "test"
});


var record = new TestModel({
  name: "test model"
});

record.save(function(e, result) {
  console.log("Saved!", result);
  
  TestModel.find(result.id, function(e, result) {
    console.log("Found!", result);
  });
});