Skip to content

Commit bdd4e99

Browse files
committed
feat: query wildcard pathname
1 parent 7964778 commit bdd4e99

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ class CoCreateFileSystem {
8080
array: 'files',
8181
$filter: {
8282
query: [
83-
{ key: "host", value: [hostname, '*'], operator: "$elemMatch" },
84-
// { key: "host", value: [hostname, '*'], operator: "$in" },
85-
{ key: "pathname", value: pathname, operator: "$eq" },
86-
// { key: "pathname", value: wildcard, operator: "$eq", logicalOperator: "or" }
83+
{ key: "host", value: [hostname, '*'], operator: "$in" },
84+
{ key: "pathname", value: pathname, operator: "$or" },
85+
{ key: "pathname", value: wildcard, operator: "$or" }
8786
],
8887
limit: 1
8988
},
@@ -92,7 +91,7 @@ class CoCreateFileSystem {
9291

9392
if (organization.host) {
9493
let host = organization.host
95-
for (let i = 0; i < host; i++) {
94+
for (let i = 0; i < host.length; i++) {
9695
if (host[i].name === hostname) {
9796
if (host[i].storage)
9897
data.storage = host[i].storage

0 commit comments

Comments
 (0)