js-bao 0.2.8 → 0.2.9

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/README.md CHANGED
@@ -1062,14 +1062,35 @@ const tutorials = await Article.query({
1062
1062
  tags: { $contains: "tutorial" },
1063
1063
  });
1064
1064
 
1065
- // Find articles with any of multiple tags
1065
+ // Find articles with any of multiple tags (OR)
1066
1066
  const techArticles = await Article.query({
1067
- tags: { $containsAny: ["javascript", "python", "react"] },
1067
+ $or: [
1068
+ { tags: { $contains: "javascript" } },
1069
+ { tags: { $contains: "python" } },
1070
+ { tags: { $contains: "react" } },
1071
+ ],
1068
1072
  });
1069
1073
 
1070
- // Find articles with all specified tags
1074
+ // Find articles that have multiple required tags (AND)
1071
1075
  const advancedTutorials = await Article.query({
1072
- tags: { $containsAll: ["tutorial", "advanced"] },
1076
+ $and: [
1077
+ { tags: { $contains: "tutorial" } },
1078
+ { tags: { $contains: "advanced" } },
1079
+ ],
1080
+ });
1081
+
1082
+ // Nested AND/OR over StringSets: "javascript" AND ("react" OR "vue" OR "node.js")
1083
+ const jsFrameworkArticles = await Article.query({
1084
+ $and: [
1085
+ { tags: { $contains: "javascript" } },
1086
+ {
1087
+ $or: [
1088
+ { tags: { $contains: "react" } },
1089
+ { tags: { $contains: "vue" } },
1090
+ { tags: { $contains: "node.js" } },
1091
+ ],
1092
+ },
1093
+ ],
1073
1094
  });
1074
1095
 
1075
1096
  // Count by tag membership
@@ -1106,6 +1127,15 @@ const tagStats = await Article.aggregate({
1106
1127
  3. Build: `npm run build` (uses `tsup`)
1107
1128
  - Development watch mode: `npm run dev`
1108
1129
 
1130
+ ## Publishing to npm
1131
+
1132
+ To publish a new version to npm:
1133
+
1134
+ 1. Update the version in `package.json`
1135
+ 2. Run `npm publish`
1136
+
1137
+ The `prepublishOnly` script automatically runs the build before publishing.
1138
+
1109
1139
  ## License
1110
1140
 
1111
1141
  This library is licensed under the ISC License. (Assuming ISC from your package.json, you might want to add a LICENSE file).
package/dist/codegen.cjs CHANGED
@@ -1007,7 +1007,7 @@ ${methods.map((method) => ` ${method}`).join("\n")}
1007
1007
  // package.json
1008
1008
  var package_default = {
1009
1009
  name: "js-bao",
1010
- version: "0.2.8",
1010
+ version: "0.2.9",
1011
1011
  description: "A library providing data modeling capabilities which support live updates and queries.",
1012
1012
  types: "dist/index.d.ts",
1013
1013
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-bao",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "A library providing data modeling capabilities which support live updates and queries.",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",