Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aurel
jio
Commits
3d191693
Commit
3d191693
authored
Jun 30, 2017
by
Aurel
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'vincentB/mappingstorage' into nodejs-romain
parents
4590a3a1
c0733eb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
12 deletions
+38
-12
src/jio.storage/mappingstorage.js
src/jio.storage/mappingstorage.js
+6
-0
test/jio.storage/mappingstorage.tests.js
test/jio.storage/mappingstorage.tests.js
+32
-12
No files found.
src/jio.storage/mappingstorage.js
View file @
3d191693
...
@@ -167,6 +167,9 @@
...
@@ -167,6 +167,9 @@
}
}
}
}
}
}
if
(
storage
.
_map_id
[
0
]
===
"
equalSubProperty
"
)
{
storage
.
_mapping_dict
[
storage
.
_map_id
[
1
]]
=
[
"
keep
"
];
}
if
(
storage
.
_query
.
query
!==
undefined
)
{
if
(
storage
.
_query
.
query
!==
undefined
)
{
query_list
.
push
(
QueryFactory
.
create
(
storage
.
_query
.
query
));
query_list
.
push
(
QueryFactory
.
create
(
storage
.
_query
.
query
));
}
}
...
@@ -344,6 +347,9 @@
...
@@ -344,6 +347,9 @@
.
push
(
function
(
sub_id
)
{
.
push
(
function
(
sub_id
)
{
return
storage
.
_sub_storage
.
put
(
sub_id
,
sub_doc
);
return
storage
.
_sub_storage
.
put
(
sub_id
,
sub_doc
);
})
})
.
push
(
function
()
{
return
doc
[
storage
.
_id_mapped
];
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
if
(
error
instanceof
jIO
.
util
.
jIOError
)
{
if
(
error
instanceof
jIO
.
util
.
jIOError
)
{
return
storage
.
_sub_storage
.
post
(
sub_doc
);
return
storage
.
_sub_storage
.
post
(
sub_doc
);
...
...
test/jio.storage/mappingstorage.tests.js
View file @
3d191693
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
deepEqual
(
deepEqual
(
jio
.
__storage
.
_mapping_dict
,
jio
.
__storage
.
_mapping_dict
,
{
"
bar
"
:
[
"
equalSubProperty
"
,
"
foo
"
]}
{
"
bar
"
:
[
"
equalSubProperty
"
,
"
foo
"
]
,
"
otherId
"
:
[
"
keep
"
]
}
);
);
deepEqual
(
jio
.
__storage
.
_map_id
,
[
"
equalSubProperty
"
,
"
otherId
"
]);
deepEqual
(
jio
.
__storage
.
_map_id
,
[
"
equalSubProperty
"
,
"
otherId
"
]);
equal
(
jio
.
__storage
.
_query
.
query
.
key
,
"
foo
"
);
equal
(
jio
.
__storage
.
_query
.
query
.
key
,
"
foo
"
);
...
@@ -130,13 +130,14 @@
...
@@ -130,13 +130,14 @@
Storage2713
.
prototype
.
get
=
function
(
id
)
{
Storage2713
.
prototype
.
get
=
function
(
id
)
{
equal
(
id
,
"
2713
"
,
"
get 2713 called
"
);
equal
(
id
,
"
2713
"
,
"
get 2713 called
"
);
return
{
"
title
"
:
"
foo
"
};
return
{
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
42
"
};
};
};
jio
.
get
(
"
42
"
)
jio
.
get
(
"
42
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
deepEqual
(
result
,
{
deepEqual
(
result
,
{
"
title
"
:
"
foo
"
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
42
"
});
});
}).
push
(
undefined
,
function
(
error
)
{
}).
push
(
undefined
,
function
(
error
)
{
ok
(
false
,
error
);
ok
(
false
,
error
);
...
@@ -169,13 +170,14 @@
...
@@ -169,13 +170,14 @@
Storage2713
.
prototype
.
get
=
function
(
id
)
{
Storage2713
.
prototype
.
get
=
function
(
id
)
{
equal
(
id
,
"
2713
"
,
"
get 2713 called
"
);
equal
(
id
,
"
2713
"
,
"
get 2713 called
"
);
return
{
"
title
"
:
"
foo
"
};
return
{
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
42
"
};
};
};
jio
.
get
(
"
42
"
)
jio
.
get
(
"
42
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
deepEqual
(
result
,
{
deepEqual
(
result
,
{
"
title
"
:
"
foo
"
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
42
"
});
});
}).
push
(
undefined
,
function
(
error
)
{
}).
push
(
undefined
,
function
(
error
)
{
ok
(
false
,
error
);
ok
(
false
,
error
);
...
@@ -652,7 +654,7 @@
...
@@ -652,7 +654,7 @@
test
(
"
with id equalSubProperty and id in doc
"
,
function
()
{
test
(
"
with id equalSubProperty and id in doc
"
,
function
()
{
stop
();
stop
();
expect
(
2
);
expect
(
3
);
var
jio
=
jIO
.
createJIO
({
var
jio
=
jIO
.
createJIO
({
type
:
"
mapping
"
,
type
:
"
mapping
"
,
...
@@ -667,9 +669,18 @@
...
@@ -667,9 +669,18 @@
return
"
42
"
;
return
"
42
"
;
};
};
Storage2713
.
prototype
.
put
=
function
(
id
,
doc
)
{
equal
(
id
,
"
bar
"
,
"
put 2713 called
"
);
deepEqual
(
doc
,
{
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
bar
"
},
"
put 2713 called
"
);
return
"
42
"
;
};
jio
.
post
({
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
bar
"
})
jio
.
post
({
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
bar
"
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
equal
(
result
,
"
42
"
);
equal
(
result
,
"
bar
"
);
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
ok
(
false
,
error
);
ok
(
false
,
error
);
...
@@ -1205,7 +1216,8 @@
...
@@ -1205,7 +1216,8 @@
"
id
"
:
"
42
"
,
"
id
"
:
"
42
"
,
"
value
"
:
{
"
value
"
:
{
"
title
"
:
"
foo
"
,
"
title
"
:
"
foo
"
,
"
smth
"
:
"
bar
"
"
smth
"
:
"
bar
"
,
"
otherId
"
:
"
42
"
},
},
"
doc
"
:
{}
"
doc
"
:
{}
},
},
...
@@ -1213,7 +1225,8 @@
...
@@ -1213,7 +1225,8 @@
"
id
"
:
"
2713
"
,
"
id
"
:
"
2713
"
,
"
value
"
:
{
"
value
"
:
{
"
title
"
:
"
bar
"
,
"
title
"
:
"
bar
"
,
"
smth
"
:
"
foo
"
"
smth
"
:
"
foo
"
,
"
otherId
"
:
"
2713
"
},
},
"
doc
"
:
{}
"
doc
"
:
{}
}
}
...
@@ -1266,7 +1279,9 @@
...
@@ -1266,7 +1279,9 @@
"
rows
"
:
[
"
rows
"
:
[
{
{
"
id
"
:
"
42
"
,
"
id
"
:
"
42
"
,
"
value
"
:
{},
"
value
"
:
{
"
otherId
"
:
"
42
"
},
"
doc
"
:
{}
"
doc
"
:
{}
}
}
],
],
...
@@ -1321,7 +1336,7 @@
...
@@ -1321,7 +1336,7 @@
"
rows
"
:
[
"
rows
"
:
[
{
{
"
id
"
:
"
42
"
,
"
id
"
:
"
42
"
,
"
value
"
:
{
"
title
"
:
"
foo
"
,
"
smth
"
:
"
bar
"
},
"
value
"
:
{
"
title
"
:
"
foo
"
,
"
smth
"
:
"
bar
"
,
"
otherId
"
:
"
42
"
},
"
doc
"
:
{}
"
doc
"
:
{}
}
}
],
],
...
@@ -1377,7 +1392,10 @@
...
@@ -1377,7 +1392,10 @@
"
rows
"
:
[
"
rows
"
:
[
{
{
"
id
"
:
"
42
"
,
"
id
"
:
"
42
"
,
"
value
"
:
{
"
title
"
:
"
foo
"
},
"
value
"
:
{
"
otherId
"
:
"
42
"
,
"
title
"
:
"
foo
"
},
"
doc
"
:
{}
"
doc
"
:
{}
}
}
],
],
...
@@ -1463,9 +1481,11 @@
...
@@ -1463,9 +1481,11 @@
result
,
result
,
[{
[{
"
title
"
:
"
bar
"
,
"
title
"
:
"
bar
"
,
"
otherId
"
:
"
foo
"
,
"
bar
"
:
"
foo
"
"
bar
"
:
"
foo
"
},
{
},
{
"
title
"
:
"
foo
"
,
"
title
"
:
"
foo
"
,
"
otherId
"
:
"
bar
"
,
"
foo
"
:
"
bar
"
"
foo
"
:
"
bar
"
}],
}],
"
bulk test
"
"
bulk test
"
...
...
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