@livequery/mongoose 2.0.5 → 2.0.6

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.
@@ -18,7 +18,7 @@ export class MongooseDatasource {
18
18
  ref
19
19
  ]));
20
20
  if (options.realtime) {
21
- const table_name = options.schema.options.collection.name;
21
+ const table_name = options.schema.options.collection;
22
22
  const $ = schema_ref.split('/');
23
23
  const is_collection_ref = $.length % 2 == 1;
24
24
  this.#realtime_collections.set(table_name, new Set([
@@ -36,7 +36,7 @@ export class MongooseDatasource {
36
36
  const db = await config.db?.(query) || process.env.DB_NAME;
37
37
  const connection = config.connection ? this.#conections[await config.connection(query)] : Object.values(this.#conections)[0];
38
38
  const schema = config.schema;
39
- const collection_name = schema.options.collection.name;
39
+ const collection_name = schema.options.collection;
40
40
  const model = connection.useDb(db).model(collection_name, schema, collection_name, schema.options);
41
41
  if (query.method == 'get')
42
42
  return await this.#get(query, model);
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "repository": {
7
7
  "url": "git@github.com:livequery/mongoose.git"
8
8
  },
9
- "version": "2.0.5",
9
+ "version": "2.0.6",
10
10
  "description": "Mongoose datasource mapping for @livequery ecosystem",
11
11
  "main": "./build/src/index.js",
12
12
  "types": "./build/src/index.d.ts",