Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agonbina/ampersand-orchestrate
[Deprecated]
https://github.com/agonbina/ampersand-orchestrate
Last synced: about 1 month ago
JSON representation
[Deprecated]
- Host: GitHub
- URL: https://github.com/agonbina/ampersand-orchestrate
- Owner: agonbina
- Created: 2014-09-11T00:11:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-12T04:41:40.000Z (over 10 years ago)
- Last Synced: 2024-04-14T20:06:24.882Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 148 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ampersand-orchestrate
=====================```js
var db = require('ampersand-orchestrate')(token);
var Model = db.Model;
var Collection = db.Collection;var WallPost = Model.Event.extend({
type: 'wallPost',
props: {
}
})var Movie = Model.extend({
collection: 'movies',
props: {
title: 'string'
}
})var LikedMovies = Collection.Graph.extend({
relationship: 'likes',
model: Movie
})var User = Model.extend({
collection: 'users',
props: {
name: 'string'
},
collections: {
wallPosts: Collection.Events.extend({ model: WallPost }),
likedMovies: LikedMovies
}
})var me = new User({ key: 'agon' })
me.get('wallPosts');
==> db.newEventBuilder().from('users', 'agon').type('wall_post')var moviesIlike = me.get('likedMovies');
==> db.newGraphReader().get().from('users', 'agon').related('likes')moviesIlike.add({ title: 'Titanic' })
==> db.newGraphBuilder().create().from('users', 'agon').related('likes').to('movies', 'Titanic')
```