Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Royer
jio
Commits
62bd25fe
Commit
62bd25fe
authored
Feb 18, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jio get API changed: jio.get("id"); -> jio.get({"_id": "id"});
parent
a62101eb
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
64 deletions
+63
-64
src/jio/jio.core.js
src/jio/jio.core.js
+4
-3
src/jio/storages/storage.js
src/jio/storages/storage.js
+1
-7
test/jiotests.js
test/jiotests.js
+58
-54
No files found.
src/jio/jio.core.js
View file @
62bd25fe
...
...
@@ -278,7 +278,8 @@ Object.defineProperty(that, "put", {
/**
* Get a document.
* @method get
* @param {string} docid The document id: "doc_id" or "doc_id/attachmt_id".
* @param {string} doc The document object. Contains at least:
* - {string} _id The document id: "doc_id" or "doc_id/attachment_id"
* @param {object} options (optional) Contains some options:
* - {number} max_retry The number max of retries, 0 = infinity.
* - {string} rev The revision we want to get.
...
...
@@ -294,14 +295,14 @@ Object.defineProperty(that, "get", {
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
id
,
options
,
success
,
error
)
{
value
:
function
(
doc
,
options
,
success
,
error
)
{
var
param
=
priv
.
parametersToObject
(
[
options
,
success
,
error
],
{
max_retry
:
3
}
);
priv
.
addJob
(
getCommand
,
{
doc
id
:
id
,
doc
:
doc
,
options
:
param
.
options
,
callbacks
:
{
success
:
param
.
success
,
error
:
param
.
error
}
});
...
...
src/jio/storages/storage.js
View file @
62bd25fe
...
...
@@ -175,16 +175,10 @@ var storage = function (spec, my) {
that
.
addJob
=
function
(
method
,
storage_spec
,
doc
,
option
,
success
,
error
)
{
var
command_opt
=
{
doc
:
doc
,
options
:
option
,
callbacks
:
{
success
:
success
,
error
:
error
}
};
if
(
doc
)
{
if
(
method
===
'
get
'
)
{
command_opt
.
docid
=
doc
;
}
else
{
command_opt
.
doc
=
doc
;
}
}
jobManager
.
addJob
(
job
({
storage
:
priv
.
storage
(
storage_spec
||
{}),
command
:
priv
.
newCommand
(
method
,
command_opt
)
...
...
test/jiotests.js
View file @
62bd25fe
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment