datafolder 1.0.29 → 1.0.31
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/ChangeLog.md +2 -0
- package/package.json +4 -4
- package/scripts/airbnb.js +3 -3
- package/scripts/airbnb2.js +3 -3
- package/scripts/airbnb_queries.js +6 -6
- package/scripts/convertBinFiles.js +2 -2
- package/scripts/fastify.js +4 -2
- package/scripts/flights.js +1 -1
- package/scripts/flights2.js +1 -1
- package/scripts/flights2_queries.js +6 -6
- package/scripts/flights_queries.js +6 -6
- package/src/QyAcl.js +87 -91
- package/src/QyBatch.d.ts +6 -4
- package/src/QyBatch.js +163 -188
- package/src/QyBinWriter.js +14 -17
- package/src/QyBinaryHeap.js +2 -2
- package/src/QyCD.js +36 -36
- package/src/QyCache.js +1 -1
- package/src/QyCompressor.js +2 -2
- package/src/QyDB.js +1 -1
- package/src/QyDir.js +12 -12
- package/src/QyEmbeddingWriter.js +2 -2
- package/src/QyEmbeddings.js +18 -18
- package/src/QyExpire.d.ts +1 -1
- package/src/QyExpire.js +5 -7
- package/src/QyExpireInfo.js +32 -32
- package/src/QyExpire_Worker.js +38 -39
- package/src/QyFile.js +73 -73
- package/src/QyFileContentUtils.js +100 -100
- package/src/QyFileLogger.js +1 -1
- package/src/QyIndex.d.ts +1 -4
- package/src/QyIndex.js +145 -154
- package/src/QyIndexPropTree.d.ts +22 -9
- package/src/QyIndexPropTree.js +66 -70
- package/src/QyIntersectNode.js +8 -10
- package/src/QyItem.js +28 -28
- package/src/QyKVData.js +42 -47
- package/src/QyKVDataCleaner_Worker.js +40 -40
- package/src/QyKVDataSaver_Worker.js +5 -7
- package/src/QyMessageWorker.js +1 -1
- package/src/QyMessager.js +5 -5
- package/src/QyOpRunner.js +2 -2
- package/src/QySaver.js +21 -21
- package/src/QySnapshotCompactor_Worker.js +12 -21
- package/src/QySnapshotSaver_Worker.js +2 -2
- package/src/QySnapshots.js +79 -89
- package/src/QyStructure.js +7 -7
- package/src/QyTrigger.js +11 -16
- package/src/QyUnionNode.js +2 -2
- package/src/QyUtils.d.ts +0 -4
- package/src/QyUtils.js +70 -98
- package/src/hackernews.js +77 -59
- package/src/rpc/getFileContent.js +5 -4
- package/src/rpc/getSubItems.js +7 -5
- package/src/simulate.js +4 -4
- package/src/simulate2.js +3 -3
- package/src/soc_pokec.js +1 -1
- package/static/codemirror.bundle/editor.bundle.js +70 -37
- package/test/testQyAQL.js +23 -23
|
@@ -4896,14 +4896,19 @@
|
|
|
4896
4896
|
for (let cur = dom, stop = false; cur && !stop;) {
|
|
4897
4897
|
if (isElt(cur)) { // Element
|
|
4898
4898
|
let bounding, top = cur == doc.body;
|
|
4899
|
-
let scaleX = 1, scaleY = 1;
|
|
4899
|
+
let scaleX = 1, scaleY = 1, xScroll = true, yScroll = true;
|
|
4900
4900
|
if (top) {
|
|
4901
4901
|
bounding = windowRect(win);
|
|
4902
4902
|
}
|
|
4903
4903
|
else {
|
|
4904
|
-
|
|
4904
|
+
let style = getComputedStyle(cur);
|
|
4905
|
+
if (/^(fixed|sticky)$/.test(style.position))
|
|
4905
4906
|
stop = true;
|
|
4906
|
-
if (cur.scrollHeight <= cur.clientHeight
|
|
4907
|
+
if (cur.scrollHeight <= cur.clientHeight || !/auto|scroll/.test(style.overflowY))
|
|
4908
|
+
yScroll = false;
|
|
4909
|
+
if (cur.scrollWidth <= cur.clientWidth || !/auto|scroll/.test(style.overflowX))
|
|
4910
|
+
xScroll = false;
|
|
4911
|
+
if (!xScroll && !yScroll) {
|
|
4907
4912
|
cur = cur.assignedSlot || cur.parentNode;
|
|
4908
4913
|
continue;
|
|
4909
4914
|
}
|
|
@@ -4914,7 +4919,8 @@
|
|
|
4914
4919
|
top: rect.top, bottom: rect.top + cur.clientHeight * scaleY };
|
|
4915
4920
|
}
|
|
4916
4921
|
let moveX = 0, moveY = 0;
|
|
4917
|
-
if (
|
|
4922
|
+
if (!yScroll) ;
|
|
4923
|
+
else if (y == "nearest") {
|
|
4918
4924
|
if (rect.top < bounding.top + yMargin) {
|
|
4919
4925
|
moveY = rect.top - (bounding.top + yMargin);
|
|
4920
4926
|
if (side > 0 && rect.bottom > bounding.bottom + moveY)
|
|
@@ -4933,7 +4939,8 @@
|
|
|
4933
4939
|
rect.bottom - boundingHeight + yMargin;
|
|
4934
4940
|
moveY = targetTop - bounding.top;
|
|
4935
4941
|
}
|
|
4936
|
-
if (
|
|
4942
|
+
if (!xScroll) ;
|
|
4943
|
+
else if (x == "nearest") {
|
|
4937
4944
|
if (rect.left < bounding.left + xMargin) {
|
|
4938
4945
|
moveX = rect.left - (bounding.left + xMargin);
|
|
4939
4946
|
if (side > 0 && rect.right > bounding.right + moveX)
|
|
@@ -4998,9 +5005,9 @@
|
|
|
4998
5005
|
break;
|
|
4999
5006
|
}
|
|
5000
5007
|
else if (isElt(cur)) {
|
|
5001
|
-
if (!y && cur.scrollHeight > cur.clientHeight)
|
|
5008
|
+
if (!y && cur.scrollHeight > cur.clientHeight && /scroll|auto/.test(getComputedStyle(cur).overflowY))
|
|
5002
5009
|
y = cur;
|
|
5003
|
-
if (getX && !x && cur.scrollWidth > cur.clientWidth)
|
|
5010
|
+
if (getX && !x && cur.scrollWidth > cur.clientWidth && /scroll|auto/.test(getComputedStyle(cur).overflowX))
|
|
5004
5011
|
x = cur;
|
|
5005
5012
|
cur = cur.assignedSlot || cur.parentNode;
|
|
5006
5013
|
}
|
|
@@ -5685,7 +5692,6 @@
|
|
|
5685
5692
|
if (type == 2 /* T.R */ || type == 4 /* T.AL */)
|
|
5686
5693
|
return RTL;
|
|
5687
5694
|
}
|
|
5688
|
-
return LTR;
|
|
5689
5695
|
}
|
|
5690
5696
|
|
|
5691
5697
|
const clickAddsSelectionRange = /*@__PURE__*/Facet.define();
|
|
@@ -5911,8 +5917,6 @@
|
|
|
5911
5917
|
let level = result;
|
|
5912
5918
|
for (let i = active.length - 1; i >= 0; i--, open--) {
|
|
5913
5919
|
let direction = active[i].spec.bidiIsolate, update;
|
|
5914
|
-
if (direction == null)
|
|
5915
|
-
direction = autoDirection(line.text, from, to);
|
|
5916
5920
|
if (open > 0 && level.length &&
|
|
5917
5921
|
(update = level[level.length - 1]).to == from && update.direction == direction) {
|
|
5918
5922
|
update.to = to;
|
|
@@ -5926,7 +5930,28 @@
|
|
|
5926
5930
|
}
|
|
5927
5931
|
}
|
|
5928
5932
|
});
|
|
5929
|
-
return result;
|
|
5933
|
+
return resolveIsolates(line.text, result);
|
|
5934
|
+
}
|
|
5935
|
+
function resolveIsolates(text, isolates) {
|
|
5936
|
+
for (let i of isolates) {
|
|
5937
|
+
if (i.direction == null) {
|
|
5938
|
+
for (let pos = i.from, j = 0; pos < i.to; j++) {
|
|
5939
|
+
let nextInner = j < i.inner.length ? i.inner[j] : null;
|
|
5940
|
+
let dir = autoDirection(text, pos, nextInner ? nextInner.from : i.to);
|
|
5941
|
+
if (dir) {
|
|
5942
|
+
i.direction = dir;
|
|
5943
|
+
break;
|
|
5944
|
+
}
|
|
5945
|
+
if (!nextInner)
|
|
5946
|
+
break;
|
|
5947
|
+
pos = nextInner.to;
|
|
5948
|
+
}
|
|
5949
|
+
if (i.direction == null)
|
|
5950
|
+
i.direction = Direction.LTR;
|
|
5951
|
+
}
|
|
5952
|
+
resolveIsolates(text, i.inner);
|
|
5953
|
+
}
|
|
5954
|
+
return isolates;
|
|
5930
5955
|
}
|
|
5931
5956
|
const scrollMargins = /*@__PURE__*/Facet.define();
|
|
5932
5957
|
function getScrollMargins(view) {
|
|
@@ -8043,12 +8068,12 @@
|
|
|
8043
8068
|
if (coords) {
|
|
8044
8069
|
let editorRect = view.dom.getBoundingClientRect();
|
|
8045
8070
|
let direction = view.textDirectionAt(block.from);
|
|
8046
|
-
let pos = view.
|
|
8071
|
+
let pos = view.posAndSideAtCoords({ x: forward == (direction == Direction.LTR) ? editorRect.right - 1 : editorRect.left + 1,
|
|
8047
8072
|
y: (coords.top + coords.bottom) / 2 });
|
|
8048
|
-
if (pos
|
|
8049
|
-
return EditorSelection.cursor(pos,
|
|
8073
|
+
if (pos)
|
|
8074
|
+
return EditorSelection.cursor(pos.pos, pos.assoc);
|
|
8050
8075
|
}
|
|
8051
|
-
return EditorSelection.cursor(forward ? block.to : block.from, forward ?
|
|
8076
|
+
return EditorSelection.cursor(forward ? block.to : block.from, forward ? 1 : -1);
|
|
8052
8077
|
}
|
|
8053
8078
|
function moveByChar(view, start, forward, by) {
|
|
8054
8079
|
let line = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line);
|
|
@@ -10656,7 +10681,7 @@
|
|
|
10656
10681
|
updateScaler() {
|
|
10657
10682
|
let scaler = this.scaler;
|
|
10658
10683
|
this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler :
|
|
10659
|
-
|
|
10684
|
+
BigScaler.get(this.heightOracle, this.heightMap, this.viewports);
|
|
10660
10685
|
return scaler.eq(this.scaler) ? 0 : 2 /* UpdateFlag.Height */;
|
|
10661
10686
|
}
|
|
10662
10687
|
updateViewportLines() {
|
|
@@ -11032,7 +11057,7 @@
|
|
|
11032
11057
|
: (this.scrollParent ? this.scrollParent.getBoundingClientRect().top : 0) - this.view.contentDOM.getBoundingClientRect().top;
|
|
11033
11058
|
}
|
|
11034
11059
|
scrollAnchorAt(scrollOffset) {
|
|
11035
|
-
let block = this.lineBlockAtHeight(scrollOffset +
|
|
11060
|
+
let block = this.lineBlockAtHeight(scrollOffset + 12 - this.paddingTop);
|
|
11036
11061
|
return block.from >= this.viewport.from || this.viewportLines[0].top - scrollOffset > 200 ? block : this.viewportLines[0];
|
|
11037
11062
|
}
|
|
11038
11063
|
elementAtHeight(height) {
|
|
@@ -11118,20 +11143,27 @@
|
|
|
11118
11143
|
// regions outside the viewports so that the total height is
|
|
11119
11144
|
// VP.MaxDOMHeight.
|
|
11120
11145
|
class BigScaler {
|
|
11121
|
-
constructor(
|
|
11146
|
+
constructor(scale, viewports) {
|
|
11147
|
+
this.scale = scale;
|
|
11148
|
+
this.viewports = viewports;
|
|
11149
|
+
}
|
|
11150
|
+
static get(oracle, heightMap, viewports) {
|
|
11122
11151
|
let vpHeight = 0, base = 0, domBase = 0;
|
|
11123
|
-
|
|
11152
|
+
let vps = viewports.map(({ from, to }) => {
|
|
11124
11153
|
let top = heightMap.lineAt(from, QueryType$1.ByPos, oracle, 0, 0).top;
|
|
11125
11154
|
let bottom = heightMap.lineAt(to, QueryType$1.ByPos, oracle, 0, 0).bottom;
|
|
11126
11155
|
vpHeight += bottom - top;
|
|
11127
11156
|
return { from, to, top, bottom, domTop: 0, domBottom: 0 };
|
|
11128
11157
|
});
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11158
|
+
if (heightMap.height - vpHeight < 10)
|
|
11159
|
+
return IdScaler;
|
|
11160
|
+
let scale = (7000000 /* VP.MaxDOMHeight */ - vpHeight) / (heightMap.height - vpHeight);
|
|
11161
|
+
for (let obj of vps) {
|
|
11162
|
+
obj.domTop = domBase + (obj.top - base) * scale;
|
|
11132
11163
|
domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top);
|
|
11133
11164
|
base = obj.bottom;
|
|
11134
11165
|
}
|
|
11166
|
+
return new BigScaler(scale, vps);
|
|
11135
11167
|
}
|
|
11136
11168
|
toDOM(n) {
|
|
11137
11169
|
for (let i = 0, base = 0, domBase = 0;; i++) {
|
|
@@ -11586,7 +11618,7 @@
|
|
|
11586
11618
|
}
|
|
11587
11619
|
onScroll(e) {
|
|
11588
11620
|
if (this.intersecting)
|
|
11589
|
-
this.flush(
|
|
11621
|
+
this.flush(this.pendingRecords().length > 0);
|
|
11590
11622
|
if (this.editContext)
|
|
11591
11623
|
this.view.requestMeasure(this.editContext.measureReq);
|
|
11592
11624
|
this.onScrollChanged(e);
|
|
@@ -15576,6 +15608,8 @@
|
|
|
15576
15608
|
if (config.class)
|
|
15577
15609
|
panel.className = config.class;
|
|
15578
15610
|
panel.classList.add("cm-dialog");
|
|
15611
|
+
let focus = typeof config.focus == "string" ? content.querySelector(config.focus)
|
|
15612
|
+
: config.focus ? content.querySelector("input") || content.querySelector("button") : null;
|
|
15579
15613
|
function done(form) {
|
|
15580
15614
|
if (panel.contains(panel.ownerDocument.activeElement))
|
|
15581
15615
|
view.focus();
|
|
@@ -15585,18 +15619,14 @@
|
|
|
15585
15619
|
dom: panel,
|
|
15586
15620
|
top: config.top,
|
|
15587
15621
|
mount: () => {
|
|
15588
|
-
if (
|
|
15589
|
-
|
|
15590
|
-
if (typeof config.focus == "string")
|
|
15591
|
-
focus = content.querySelector(config.focus);
|
|
15592
|
-
else
|
|
15593
|
-
focus = content.querySelector("input") || content.querySelector("button");
|
|
15594
|
-
if (focus && "select" in focus)
|
|
15622
|
+
if (focus) {
|
|
15623
|
+
if ("select" in focus)
|
|
15595
15624
|
focus.select();
|
|
15596
|
-
else if (
|
|
15625
|
+
else if ("focus" in focus)
|
|
15597
15626
|
focus.focus();
|
|
15598
15627
|
}
|
|
15599
|
-
}
|
|
15628
|
+
},
|
|
15629
|
+
destroy: () => result(null)
|
|
15600
15630
|
};
|
|
15601
15631
|
}
|
|
15602
15632
|
|
|
@@ -17453,13 +17483,16 @@
|
|
|
17453
17483
|
cursor.next();
|
|
17454
17484
|
let localChildren = [], localPositions = [];
|
|
17455
17485
|
let localInRepeat = id >= minRepeatType ? id : -1;
|
|
17456
|
-
let lastGroup = 0, lastEnd = end;
|
|
17486
|
+
let lastGroup = 0, lastEnd = end, groupLookAhead = lookAheadAtStart;
|
|
17457
17487
|
while (cursor.pos > endPos) {
|
|
17458
17488
|
if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {
|
|
17459
17489
|
if (cursor.end <= lastEnd - maxBufferLength) {
|
|
17460
|
-
makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat,
|
|
17490
|
+
makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, groupLookAhead, contextAtStart);
|
|
17461
17491
|
lastGroup = localChildren.length;
|
|
17462
17492
|
lastEnd = cursor.end;
|
|
17493
|
+
// The buffer is read backwards, so the current look-ahead is
|
|
17494
|
+
// the one recorded after the next group's end.
|
|
17495
|
+
groupLookAhead = lookAhead;
|
|
17463
17496
|
}
|
|
17464
17497
|
cursor.next();
|
|
17465
17498
|
}
|
|
@@ -17471,7 +17504,7 @@
|
|
|
17471
17504
|
}
|
|
17472
17505
|
}
|
|
17473
17506
|
if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)
|
|
17474
|
-
makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat,
|
|
17507
|
+
makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, groupLookAhead, contextAtStart);
|
|
17475
17508
|
localChildren.reverse();
|
|
17476
17509
|
localPositions.reverse();
|
|
17477
17510
|
if (localInRepeat > -1 && lastGroup > 0) {
|
|
@@ -17524,7 +17557,7 @@
|
|
|
17524
17557
|
if (!lastI && last.type == type && last.length == length)
|
|
17525
17558
|
return last;
|
|
17526
17559
|
if (lookAheadProp = last.prop(NodeProp.lookAhead))
|
|
17527
|
-
lookAhead = positions[lastI] + last.length + lookAheadProp;
|
|
17560
|
+
lookAhead = positions[lastI] + last.length + lookAheadProp - length;
|
|
17528
17561
|
}
|
|
17529
17562
|
return makeTree(type, children, positions, length, lookAhead, contextHash);
|
|
17530
17563
|
};
|
|
@@ -24618,7 +24651,7 @@
|
|
|
24618
24651
|
keydown(event, view) {
|
|
24619
24652
|
let field = view.state.field(completionState, false);
|
|
24620
24653
|
if (!field || !field.open || field.open.disabled || field.open.selected < 0 ||
|
|
24621
|
-
event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
|
|
24654
|
+
!event.key || event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
|
|
24622
24655
|
return false;
|
|
24623
24656
|
let option = field.open.options[field.open.selected];
|
|
24624
24657
|
let result = field.active.find(a => a.source == option.source);
|
package/test/testQyAQL.js
CHANGED
|
@@ -14,7 +14,7 @@ function query1(qyDB) {
|
|
|
14
14
|
}
|
|
15
15
|
// FOR doc IN employees
|
|
16
16
|
// LET isOlder = doc.age > 30
|
|
17
|
-
// LET isSales = doc.department
|
|
17
|
+
// LET isSales = doc.department === "sales"
|
|
18
18
|
// FILTER isOlder && isSales
|
|
19
19
|
// RETURN doc
|
|
20
20
|
function query2(qyDB) {
|
|
@@ -50,7 +50,7 @@ function query5(qyDB) {
|
|
|
50
50
|
const result = {};
|
|
51
51
|
qyDB.fetch
|
|
52
52
|
.queryFiles("employees", {
|
|
53
|
-
department: (x) => x
|
|
53
|
+
department: (x) => x === "sales",
|
|
54
54
|
age: (x) => x > 30,
|
|
55
55
|
})
|
|
56
56
|
.run()[0]
|
|
@@ -64,7 +64,7 @@ function query5(qyDB) {
|
|
|
64
64
|
function query6(qyDB) {
|
|
65
65
|
const result = qyDB
|
|
66
66
|
.queryFiles("employees", {
|
|
67
|
-
department: (x) => x
|
|
67
|
+
department: (x) => x !== "sales",
|
|
68
68
|
age: (x) => x > 30,
|
|
69
69
|
})
|
|
70
70
|
.reduce((map, x) => {
|
|
@@ -80,7 +80,7 @@ function query6(qyDB) {
|
|
|
80
80
|
function query7(qyDB) {
|
|
81
81
|
const result = {};
|
|
82
82
|
const queryObj = {
|
|
83
|
-
department: (x) => x
|
|
83
|
+
department: (x) => x === "sales",
|
|
84
84
|
age: (x) => x > 30,
|
|
85
85
|
};
|
|
86
86
|
["employees", "employees/*/*"].forEach((folderPath) => {
|
|
@@ -104,7 +104,7 @@ function query7(qyDB) {
|
|
|
104
104
|
function query8(qyDB) {
|
|
105
105
|
const result = ["employees", ["employees", "*", "*"]]
|
|
106
106
|
.map((folderPath) => qyDB.queryFiles(folderPath, {
|
|
107
|
-
department: (x) => x
|
|
107
|
+
department: (x) => x !== "sales",
|
|
108
108
|
age: (x) => x > 30,
|
|
109
109
|
}))
|
|
110
110
|
.flat()
|
|
@@ -125,7 +125,7 @@ function query8(qyDB) {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
function query9(qyDB) {
|
|
128
|
-
const queryObj = { $and: [{ department: (x) => x
|
|
128
|
+
const queryObj = { $and: [{ department: (x) => x !== "sales" }, { age: (x) => x > 30 }] };
|
|
129
129
|
deepEqual(qyDB.fetch
|
|
130
130
|
.cd("employees")
|
|
131
131
|
.queryFiles("2024/12", queryObj)
|
|
@@ -155,7 +155,7 @@ function query9(qyDB) {
|
|
|
155
155
|
}
|
|
156
156
|
function query10(qyDB) {
|
|
157
157
|
const queryObj = {
|
|
158
|
-
$or: [{ department: (x) => x
|
|
158
|
+
$or: [{ department: (x) => x !== "sales", age: (x) => x > 36 }, { age: (x) => x > 40 }],
|
|
159
159
|
};
|
|
160
160
|
deepEqual(qyDB.fetch
|
|
161
161
|
.cd("employees")
|
|
@@ -182,7 +182,7 @@ function query11(qyDB) {
|
|
|
182
182
|
const queryObj = {
|
|
183
183
|
$and: [
|
|
184
184
|
{
|
|
185
|
-
$or: [{ department: (x) => x
|
|
185
|
+
$or: [{ department: (x) => x !== "sales", age: (x) => x > 36 }],
|
|
186
186
|
},
|
|
187
187
|
{ age: (x) => x > 40 },
|
|
188
188
|
],
|
|
@@ -205,12 +205,12 @@ function query11(qyDB) {
|
|
|
205
205
|
}
|
|
206
206
|
function query12(qyDB) {
|
|
207
207
|
const queryObj = {
|
|
208
|
-
$and: { department: (x) => x
|
|
208
|
+
$and: { department: (x) => x !== "sales", age: (x) => x > 36 },
|
|
209
209
|
age: (x) => x > 40,
|
|
210
210
|
};
|
|
211
211
|
deepEqual(qyDB.fetch
|
|
212
212
|
.cd("employees")
|
|
213
|
-
.queryFiles([(x) => x >= 2024 && x <= 2025, (x) => x
|
|
213
|
+
.queryFiles([(x) => x >= 2024 && x <= 2025, (x) => x !== 10], queryObj, 2)
|
|
214
214
|
.queryFiles(".", queryObj, 2)
|
|
215
215
|
.run()
|
|
216
216
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -225,10 +225,10 @@ function query12(qyDB) {
|
|
|
225
225
|
]);
|
|
226
226
|
}
|
|
227
227
|
function query13(qyDB) {
|
|
228
|
-
const queryObj = { $and: { department: (x) => x
|
|
228
|
+
const queryObj = { $and: { department: (x) => x !== "sales", age: (x) => x > 36 }, age: (x) => x > 40 };
|
|
229
229
|
deepEqual(qyDB.fetch
|
|
230
230
|
.cd("employees")
|
|
231
|
-
.queryFiles([(x) => x >= 2024 && x <= 2025, (x) => x
|
|
231
|
+
.queryFiles([(x) => x >= 2024 && x <= 2025, (x) => x !== 10], queryObj, 1)
|
|
232
232
|
.queryFiles(".", queryObj, 1)
|
|
233
233
|
.run()
|
|
234
234
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -240,10 +240,10 @@ function query13(qyDB) {
|
|
|
240
240
|
]);
|
|
241
241
|
}
|
|
242
242
|
function query14(qyDB) {
|
|
243
|
-
const queryObj = { $and: { department: (x) => x
|
|
243
|
+
const queryObj = { $and: { department: (x) => x !== "sales", age: (x) => x > 36 }, age: (x) => x > 40 };
|
|
244
244
|
deepEqual(qyDB.fetch
|
|
245
245
|
.cd("employees")
|
|
246
|
-
.queryFiles([(x) => x >= 2024 && x <= 2025, (x) => x
|
|
246
|
+
.queryFiles([(x) => x >= 2024 && x <= 2025, (x) => x !== 10], queryObj, 1, 1)
|
|
247
247
|
.queryFiles(".", queryObj, 1, 1)
|
|
248
248
|
.run()
|
|
249
249
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -252,7 +252,7 @@ function query14(qyDB) {
|
|
|
252
252
|
}, {})), [{ "/employees/2025/03/employee_2_9": { age: 46, department: "R&D" } }, {}]);
|
|
253
253
|
deepEqual(qyDB.fetch
|
|
254
254
|
.cd("employees")
|
|
255
|
-
.queryFiles([{ $gte: 2024, $lte: 2025 }, (x) => x
|
|
255
|
+
.queryFiles([{ $gte: 2024, $lte: 2025 }, (x) => x !== 10], queryObj, 1, 1)
|
|
256
256
|
.queryFiles(".", queryObj, 1, 1)
|
|
257
257
|
.run()
|
|
258
258
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -261,7 +261,7 @@ function query14(qyDB) {
|
|
|
261
261
|
}, {})), [{ "/employees/2025/03/employee_2_9": { age: 46, department: "R&D" } }, {}]);
|
|
262
262
|
deepEqual(qyDB.fetch
|
|
263
263
|
.cd("employees")
|
|
264
|
-
.queryFiles([{ $gt: 2023, $gte: 2024, $lte: 2025, $lt: 2026 }, (x) => x
|
|
264
|
+
.queryFiles([{ $gt: 2023, $gte: 2024, $lte: 2025, $lt: 2026 }, (x) => x !== 10], queryObj, 1, 1)
|
|
265
265
|
.queryFiles(".", queryObj, 1, 1)
|
|
266
266
|
.run()
|
|
267
267
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -270,17 +270,17 @@ function query14(qyDB) {
|
|
|
270
270
|
}, {})), [{ "/employees/2025/03/employee_2_9": { age: 46, department: "R&D" } }, {}]);
|
|
271
271
|
deepEqual(qyDB.fetch
|
|
272
272
|
.cd("employees")
|
|
273
|
-
.queryFiles([{ $gt: 2023, $gte: 2024, $lte: 2025, $lt: 2025 }, (x) => x
|
|
273
|
+
.queryFiles([{ $gt: 2023, $gte: 2024, $lte: 2025, $lt: 2025 }, (x) => x !== 10], queryObj, 1, 1)
|
|
274
274
|
.queryFiles(".", queryObj, 1, 1)
|
|
275
275
|
.run(), [[], []]);
|
|
276
276
|
deepEqual(qyDB.fetch
|
|
277
277
|
.cd("employees")
|
|
278
|
-
.queryFiles([{ $gt: 2024, $gte: 2024, $lte: 2025, $lt: 2026 }, (x) => x
|
|
278
|
+
.queryFiles([{ $gt: 2024, $gte: 2024, $lte: 2025, $lt: 2026 }, (x) => x !== 10], queryObj, 1, 1)
|
|
279
279
|
.queryFiles(".", queryObj, 1, 1)
|
|
280
280
|
.run(), [[], []]);
|
|
281
281
|
deepEqual(qyDB.fetch
|
|
282
282
|
.cd("employees")
|
|
283
|
-
.queryFiles([{ $or: [2024, 2025] }, (x) => x
|
|
283
|
+
.queryFiles([{ $or: [2024, 2025] }, (x) => x !== 10], queryObj, 1, 1)
|
|
284
284
|
.queryFiles(".", queryObj, 1, 1)
|
|
285
285
|
.run()
|
|
286
286
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -289,7 +289,7 @@ function query14(qyDB) {
|
|
|
289
289
|
}, {})), [{ "/employees/2025/03/employee_2_9": { age: 46, department: "R&D" } }, {}]);
|
|
290
290
|
deepEqual(qyDB.fetch
|
|
291
291
|
.cd("employees")
|
|
292
|
-
.queryFiles([{ $in: [2023, 2024, 2025] }, (x) => x
|
|
292
|
+
.queryFiles([{ $in: [2023, 2024, 2025] }, (x) => x !== 10], queryObj, 1, 1)
|
|
293
293
|
.queryFiles(".", queryObj, 1, 1)
|
|
294
294
|
.run()
|
|
295
295
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -298,11 +298,11 @@ function query14(qyDB) {
|
|
|
298
298
|
}, {})), [{ "/employees/2025/03/employee_2_9": { age: 46, department: "R&D" } }, {}]);
|
|
299
299
|
}
|
|
300
300
|
function query15(qyDB) {
|
|
301
|
-
const queryObj = { $and: { department: (x) => x
|
|
301
|
+
const queryObj = { $and: { department: (x) => x !== "sales", age: (x) => x > 36 }, age: (x) => x > 40 };
|
|
302
302
|
deepEqual(qyDB.fetch
|
|
303
303
|
.cd("employees")
|
|
304
304
|
.queryFiles({
|
|
305
|
-
$or: [".", [(x) => x >= 2024 && x <= 2025, (x) => x
|
|
305
|
+
$or: [".", [(x) => x >= 2024 && x <= 2025, (x) => x !== 10]],
|
|
306
306
|
}, queryObj, 10, 0)
|
|
307
307
|
.run()
|
|
308
308
|
.map((list) => list.reduce((map, x) => {
|
|
@@ -318,7 +318,7 @@ function query15(qyDB) {
|
|
|
318
318
|
}
|
|
319
319
|
function query16(qyDB) {
|
|
320
320
|
const queryObj = {
|
|
321
|
-
$and: { department: (x) => x
|
|
321
|
+
$and: { department: (x) => x !== "sales", age: (x) => x > 36 },
|
|
322
322
|
age: (x) => x > 40,
|
|
323
323
|
};
|
|
324
324
|
deepEqual(qyDB.fetch
|