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
Alain Takoudjou
jio
Commits
bc58be4f
Commit
bc58be4f
authored
Jul 17, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gidstorage remove method done
parent
6d392a7c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
src/jio.storage/gidstorage.js
src/jio.storage/gidstorage.js
+44
-0
No files found.
src/jio.storage/gidstorage.js
View file @
bc58be4f
...
...
@@ -391,6 +391,50 @@
});
};
that
.
remove
=
function
(
command
)
{
setTimeout
(
function
()
{
var
gid_object
,
complex_query
,
doc
=
command
.
cloneDoc
();
gid_object
=
gidParse
(
doc
.
_id
,
priv
.
constraints
);
if
(
gid_object
===
undefined
)
{
return
that
.
error
({
"
status
"
:
409
,
"
statusText
"
:
"
Conflict
"
,
"
error
"
:
"
conflict
"
,
"
message
"
:
"
Cannot remove document
"
,
"
reason
"
:
"
metadata should respect constraints
"
});
}
complex_query
=
gidToComplexQuery
(
gid_object
);
that
.
addJob
(
'
allDocs
'
,
priv
.
sub_storage
,
{},
{
"
query
"
:
complex_query
,
"
wildcard_character
"
:
null
},
function
(
response
)
{
if
(
response
.
total_rows
===
0
)
{
return
that
.
error
({
"
status
"
:
404
,
"
statusText
"
:
"
Not found
"
,
"
error
"
:
"
not_found
"
,
"
message
"
:
"
Cannot remove document
"
,
"
reason
"
:
"
missing
"
});
}
gid_object
=
doc
.
_id
;
doc
=
{
"
_id
"
:
response
.
rows
[
0
].
id
};
that
.
addJob
(
'
remove
'
,
priv
.
sub_storage
,
doc
,
{
},
function
(
response
)
{
response
.
id
=
gid_object
;
that
.
success
(
response
);
},
function
(
err
)
{
err
.
message
=
"
Cannot remove document
"
;
that
.
error
(
err
);
});
},
function
(
err
)
{
err
.
message
=
"
Cannot remove document
"
;
that
.
error
(
err
);
});
});
};
that
.
allDocs
=
function
(
command
)
{
setTimeout
(
function
()
{
var
options
=
command
.
cloneOption
(),
include_docs
;
...
...
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