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
f77d1edc
Commit
f77d1edc
authored
Dec 19, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indexstorage.js allDocs include_docs added
parent
2129be4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
src/jio.storage/indexstorage.js
src/jio.storage/indexstorage.js
+12
-5
No files found.
src/jio.storage/indexstorage.js
View file @
f77d1edc
...
...
@@ -698,10 +698,6 @@
IndexStorage
.
prototype
.
allDocs
=
function
(
command
,
param
,
option
)
{
// XXX
/*jslint unparam: true */
var
index
=
this
.
selectIndex
(
option
.
select_list
||
[]),
delete_id
;
// Include docs option is ignored, if you want to get all the document,
// don't use index storage!
option
.
select_list
=
(
Array
.
isArray
(
option
.
select_list
)
?
option
.
select_list
:
[]
);
...
...
@@ -710,8 +706,15 @@
delete_id
=
true
;
}
this
.
getIndexDatabase
(
command
,
index
).
then
(
function
(
db
)
{
var
i
,
id
;
var
i
,
id
,
now
;
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
];
}
}
complex_queries
.
QueryFactory
.
create
(
option
.
query
||
''
).
exec
(
db
,
option
);
for
(
i
=
0
;
i
<
db
.
length
;
i
+=
1
)
{
...
...
@@ -723,6 +726,10 @@
"
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
}});
},
function
(
err
)
{
...
...
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