Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Hardik Juneja
jio-main
Commits
67383d7b
Commit
67383d7b
authored
Dec 19, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indexstorage.js include_docs no doc returned fix
parent
f77d1edc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
src/jio.storage/indexstorage.js
src/jio.storage/indexstorage.js
+17
-9
No files found.
src/jio.storage/indexstorage.js
View file @
67383d7b
...
...
@@ -697,7 +697,7 @@
*/
IndexStorage
.
prototype
.
allDocs
=
function
(
command
,
param
,
option
)
{
// XXX
/*jslint unparam: true */
var
index
=
this
.
selectIndex
(
option
.
select_list
||
[]),
delete_id
;
var
index
=
this
.
selectIndex
(
option
.
select_list
||
[]),
delete_id
,
now
;
option
.
select_list
=
(
Array
.
isArray
(
option
.
select_list
)
?
option
.
select_list
:
[]
);
...
...
@@ -705,12 +705,15 @@
option
.
select_list
.
push
(
"
_id
"
);
delete_id
=
true
;
}
if
(
option
.
include_docs
)
{
now
=
Date
.
now
();
option
.
select_list
.
push
(
"
_
"
+
now
);
}
this
.
getIndexDatabase
(
command
,
index
).
then
(
function
(
db
)
{
var
i
,
id
,
now
;
var
i
,
id
;
db
=
db
.
_database
;
if
(
option
.
include_docs
)
{
// XXX find another way to manage include_docs option!!
now
=
Date
.
now
();
for
(
i
=
0
;
i
<
db
.
length
;
i
+=
1
)
{
db
[
i
][
"
_
"
+
now
]
=
db
[
i
];
}
...
...
@@ -722,13 +725,18 @@
if
(
delete_id
)
{
delete
db
[
i
].
_id
;
}
if
(
option
.
include_docs
)
{
db
[
i
]
=
{
"
id
"
:
id
,
"
value
"
:
db
[
i
],
"
doc
"
:
db
[
i
][
"
_
"
+
now
]
};
delete
db
[
i
].
doc
[
"
_
"
+
now
];
}
else
{
db
[
i
]
=
{
"
id
"
:
id
,
"
value
"
:
db
[
i
]
};
if
(
option
.
include_docs
)
{
db
[
i
].
doc
=
db
[
i
][
"
_
"
+
now
];
delete
db
[
i
][
"
_
"
+
now
];
}
}
command
.
success
(
200
,
{
"
data
"
:
{
"
total_rows
"
:
db
.
length
,
"
rows
"
:
db
}});
...
...
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