Skip to content

holonomy/orgs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published