w-orm-mongodb 1.1.27 → 1.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +17 -17
- package/babel.config.js +1 -0
- package/dist/w-orm-mongodb.umd.js +2 -2
- package/dist/w-orm-mongodb.umd.js.map +1 -1
- package/docs/WOrmMongodb.html +110 -99
- package/docs/WOrmMongodb.mjs.html +495 -403
- package/docs/index.html +4 -1
- package/docs/scripts/collapse.js +19 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/search.js +16 -0
- package/docs/styles/jsdoc.css +13 -2
- package/docs/styles/prettify.css +1 -0
- package/g-basic.mjs +5 -1
- package/g-gfs.mjs +12 -1
- package/package.json +4 -4
- package/src/WOrmMongodb.mjs +491 -402
- package/test/basic.test.mjs +400 -0
- package/test/gfs.test.mjs +188 -0
- package/test/all.test.mjs +0 -10
package/docs/index.html
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
15
|
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
16
|
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
|
|
17
18
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
19
|
</head>
|
|
19
20
|
<body>
|
|
@@ -27,7 +28,9 @@
|
|
|
27
28
|
|
|
28
29
|
<nav >
|
|
29
30
|
|
|
31
|
+
|
|
30
32
|
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WOrmMongodb.html">WOrmMongodb</a><ul class='methods'><li data-type='method'><a href="WOrmMongodb.html#.del">del</a></li><li data-type='method'><a href="WOrmMongodb.html#.delAll">delAll</a></li><li data-type='method'><a href="WOrmMongodb.html#.delAllGfs">delAllGfs</a></li><li data-type='method'><a href="WOrmMongodb.html#.delGfs">delGfs</a></li><li data-type='method'><a href="WOrmMongodb.html#.insert">insert</a></li><li data-type='method'><a href="WOrmMongodb.html#.insertGfs">insertGfs</a></li><li data-type='method'><a href="WOrmMongodb.html#.save">save</a></li><li data-type='method'><a href="WOrmMongodb.html#.select">select</a></li><li data-type='method'><a href="WOrmMongodb.html#.selectGfs">selectGfs</a></li></ul></li></ul>
|
|
33
|
+
|
|
31
34
|
</nav>
|
|
32
35
|
|
|
33
36
|
<div id="main">
|
|
@@ -68,7 +71,7 @@
|
|
|
68
71
|
<br class="clear">
|
|
69
72
|
|
|
70
73
|
<footer>
|
|
71
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Mar 30 2023 11:53:34 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
72
75
|
</footer>
|
|
73
76
|
|
|
74
77
|
<script>prettyPrint();</script>
|
package/docs/scripts/collapse.js
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
function hideAllButCurrent(){
|
|
2
2
|
//by default all submenut items are hidden
|
|
3
3
|
//but we need to rehide them for search
|
|
4
|
+
document.querySelectorAll("nav > ul").forEach(function(parent) {
|
|
5
|
+
if (parent.className.indexOf("collapse_top") !== -1) {
|
|
6
|
+
parent.style.display = "none";
|
|
7
|
+
}
|
|
8
|
+
});
|
|
4
9
|
document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
|
|
5
10
|
parent.style.display = "none";
|
|
6
11
|
});
|
|
12
|
+
document.querySelectorAll("nav > h3").forEach(function(section) {
|
|
13
|
+
if (section.className.indexOf("collapsed_header") !== -1) {
|
|
14
|
+
section.addEventListener("click", function(){
|
|
15
|
+
if (section.nextSibling.style.display === "none") {
|
|
16
|
+
section.nextSibling.style.display = "block";
|
|
17
|
+
} else {
|
|
18
|
+
section.nextSibling.style.display = "none";
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
7
23
|
|
|
8
24
|
//only current page (if it exists) should be opened
|
|
9
25
|
var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
|
|
10
26
|
document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
|
|
11
27
|
var href = parent.attributes.href.value.replace(/\.html/, '');
|
|
12
28
|
if (file === href) {
|
|
29
|
+
if (parent.parentNode.parentNode.className.indexOf("collapse_top") !== -1) {
|
|
30
|
+
parent.parentNode.parentNode.style.display = "block";
|
|
31
|
+
}
|
|
13
32
|
parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
|
|
14
33
|
elem.style.display = "block";
|
|
15
34
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
if (typeof fetch === 'function') {
|
|
2
|
+
const init = () => {
|
|
3
|
+
if (typeof scrollToNavItem !== 'function') return false
|
|
4
|
+
scrollToNavItem()
|
|
5
|
+
// hideAllButCurrent not always loaded
|
|
6
|
+
if (typeof hideAllButCurrent === 'function') hideAllButCurrent()
|
|
7
|
+
return true
|
|
8
|
+
}
|
|
9
|
+
fetch('./nav.inc.html')
|
|
10
|
+
.then(response => response.ok ? response.text() : `${response.url} => ${response.status} ${response.statusText}`)
|
|
11
|
+
.then(body => {
|
|
12
|
+
document.querySelector('nav').innerHTML += body
|
|
13
|
+
// nav.js should be quicker to load than nav.inc.html, a fallback just in case
|
|
14
|
+
return init()
|
|
15
|
+
})
|
|
16
|
+
.then(done => {
|
|
17
|
+
if (done) return
|
|
18
|
+
let i = 0
|
|
19
|
+
;(function waitUntilNavJs () {
|
|
20
|
+
if (init()) return
|
|
21
|
+
if (i++ < 100) return setTimeout(waitUntilNavJs, 300)
|
|
22
|
+
console.error(Error('nav.js not loaded after 30s waiting for it'))
|
|
23
|
+
})()
|
|
24
|
+
})
|
|
25
|
+
.catch(error => console.error(error))
|
|
26
|
+
} else {
|
|
27
|
+
console.error(Error('Browser too old to display commonNav (remove commonNav docdash option)'))
|
|
28
|
+
}
|
package/docs/scripts/search.js
CHANGED
|
@@ -33,6 +33,9 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
|
|
|
33
33
|
document.querySelectorAll("nav > ul > li").forEach(function(elem) {
|
|
34
34
|
elem.style.display = "block";
|
|
35
35
|
});
|
|
36
|
+
document.querySelectorAll("nav > ul").forEach(function(elem) {
|
|
37
|
+
elem.style.display = "block";
|
|
38
|
+
});
|
|
36
39
|
//hide all results
|
|
37
40
|
document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
|
|
38
41
|
elem.style.display = "none";
|
|
@@ -79,5 +82,18 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
|
|
|
79
82
|
parent.style.display = "none";
|
|
80
83
|
}
|
|
81
84
|
});
|
|
85
|
+
document.querySelectorAll("nav > ul.collapse_top").forEach(function(parent) {
|
|
86
|
+
var countVisible = 0;
|
|
87
|
+
parent.querySelectorAll("li").forEach(function(elem) {
|
|
88
|
+
if (elem.style.display !== "none") {
|
|
89
|
+
countVisible++;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (countVisible == 0) {
|
|
94
|
+
//has no child at all and does not contain text
|
|
95
|
+
parent.style.display = "none";
|
|
96
|
+
}
|
|
97
|
+
});
|
|
82
98
|
}
|
|
83
99
|
});
|
package/docs/styles/jsdoc.css
CHANGED
|
@@ -162,12 +162,19 @@ h6 {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
tt, code, kbd, samp {
|
|
165
|
+
tt, code, kbd, samp, pre {
|
|
166
166
|
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
|
167
167
|
background: #f4f4f4;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
tt, code, kbd, samp{
|
|
168
171
|
padding: 1px 5px;
|
|
169
172
|
}
|
|
170
173
|
|
|
174
|
+
pre {
|
|
175
|
+
padding-bottom: 1em;
|
|
176
|
+
}
|
|
177
|
+
|
|
171
178
|
.class-description {
|
|
172
179
|
font-size: 130%;
|
|
173
180
|
line-height: 140%;
|
|
@@ -242,6 +249,10 @@ nav h3 {
|
|
|
242
249
|
color: #000;
|
|
243
250
|
}
|
|
244
251
|
|
|
252
|
+
nav h3.collapsed_header {
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
}
|
|
255
|
+
|
|
245
256
|
nav ul {
|
|
246
257
|
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
|
|
247
258
|
font-size: 100%;
|
|
@@ -762,4 +773,4 @@ html[data-search-mode] .level-hide {
|
|
|
762
773
|
font-weight: 300;
|
|
763
774
|
font-style: normal;
|
|
764
775
|
|
|
765
|
-
}
|
|
776
|
+
}
|
package/docs/styles/prettify.css
CHANGED
package/g-basic.mjs
CHANGED
|
@@ -158,7 +158,11 @@ test()
|
|
|
158
158
|
// }
|
|
159
159
|
// ]
|
|
160
160
|
// select by $or, $and, $ne, $in, $nin [
|
|
161
|
-
// {
|
|
161
|
+
// {
|
|
162
|
+
// id: 'id-rosemary',
|
|
163
|
+
// name: 'rosemary(modify)',
|
|
164
|
+
// value: 123.456
|
|
165
|
+
// },
|
|
162
166
|
// {
|
|
163
167
|
// id: {random id},
|
|
164
168
|
// name: 'kettle',
|
package/g-gfs.mjs
CHANGED
|
@@ -26,10 +26,15 @@ async function test() {
|
|
|
26
26
|
//fn_in, fn_out
|
|
27
27
|
let fn_in = path.resolve('../', './_data', 'data(in).dat')
|
|
28
28
|
let fn_out = path.resolve('../', './_data', 'data(out).dat')
|
|
29
|
+
// console.log('fn_in', fn_in)
|
|
30
|
+
// console.log('fn_out', fn_out)
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
//unlinkSync
|
|
32
|
-
|
|
34
|
+
try {
|
|
35
|
+
fs.unlinkSync(fn_out)
|
|
36
|
+
}
|
|
37
|
+
catch (err) {}
|
|
33
38
|
|
|
34
39
|
|
|
35
40
|
//u8a
|
|
@@ -57,6 +62,12 @@ async function test() {
|
|
|
57
62
|
//selectGfs
|
|
58
63
|
let gs = await w.selectGfs(gi.id)
|
|
59
64
|
console.log('selectGfs', gs)
|
|
65
|
+
console.log('gs[0]', gs[0], gs[0] === 0)
|
|
66
|
+
console.log('gs[1]', gs[1], gs[1] === 0)
|
|
67
|
+
console.log('gs[2]', gs[2], gs[2] === 0)
|
|
68
|
+
console.log('gs[3]', gs[3], gs[3] === 24)
|
|
69
|
+
console.log('gs[4]', gs[4], gs[4] === 102)
|
|
70
|
+
console.log('gs.length', gs.length, gs.length === 47381362)
|
|
60
71
|
fs.writeFileSync(fn_out, gs)
|
|
61
72
|
|
|
62
73
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "w-orm-mongodb",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"main": "dist/w-orm-mongodb.umd.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"mongodb": "^
|
|
6
|
+
"mongodb": "^5.1.0",
|
|
7
7
|
"saslprep": "^1.0.3",
|
|
8
8
|
"lodash": "^4.17.21",
|
|
9
|
-
"wsemi": "^1.
|
|
9
|
+
"wsemi": "^1.7.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"w-package-tools": "^1.0.
|
|
12
|
+
"w-package-tools": "^1.0.68"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
|