No description, website, or topics provided.
Switch branches/tags
Nothing to show
Latest commit a057a55 Feb 10, 2014 @ahdinosaur ahdinosaur s/levelgraph-orgs/orgs/
Permalink
Failed to load latest commit information.
README.md
package.json

README.md

orgs

store, retrieve, delete, and search org:Organizations using levelgraph-jsonld

methods

var level = require('level');
var db = level('./mydb');
var orgs = require('orgs')(db, opts);

orgs.put(obj, function (err, obj) {

Storing organizations is extremely easy:

var wbcg = {
  "@id": "https://web-payments.org#org",
  "name": "Web Payments Community Group",
  "homepage": "https://web-payments.org"
};

orgs.put(wbcg, function(err, obj) {
  // do something after the obj is inserted
});

orgs.get(id, function (err, obj) {

Retrieving a JSON-LD object from the store requires its '@id':

orgs.get(wbcg['@id'], function(err, obj) {
  // obj will be the very same of the wbcg object
});

orgs.del(id, function (err) {

In order to delete an object, you can just pass it's '@id' to the '@del' method:

orgs.del(wbcg['@id'], function(err) {
  // do something after it is deleted!
});

orgs.search(constraints, function (err, solution) {

TODO

license

MIT