Skip to content

Instantly share code, notes, and snippets.

@swannodette
Forked from avital/SSCollectionJSON.js
Created January 22, 2009 23:21
Show Gist options
  • Save swannodette/50784 to your computer and use it in GitHub Desktop.
Save swannodette/50784 to your computer and use it in GitHub Desktop.
read
----
{
"action": "read",
"table": "user/shift/trail/comment",
"constraints": {
"user_id": 67
},
"properties": "*" || ["username", "summary", "modified"],
"orderby": ["<" || ">", "modified"],
"startIndex": 2,
"range": {
"startIndex": 2, // array base is 0
"count": 20
}
}
- returns array of results
delete
------
{
"action": "delete",
"table": "user/shift/trail/comment",
"constraints": {
"user_id": 67
},
}
- returns number of rows deleted
update
------
{
"action": "update",
"table": "user/shift/trail/comment",
"constraints": {
"user_id": 67
},
"values": {
"user_id": 68,
"name": "Avital"
}
}
- returns number of rows updated
create
------
{
"action": "create",
"table": "user/shift/trail/comment",
"values": {
"name": "Avital"
}
}
- returns new id
table mapping
++++++++++++++
{
"virtual": "worksinset.read",
"properties": ["tag", "position", "note"],
"map": {
{from:"artworkid", to:"artwork.id", properties:["title", "image", "artist", "date"]}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment