New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

octonom-mongodb

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octonom-mongodb - npm Package Compare versions

Comparing version 1.0.0-alpha.5 to 1.0.0-alpha.6

8

build/lib/mongo-collection.d.ts
import { Collection as DbCollection, CollectionInsertManyOptions, Cursor, Db, FindOneOptions } from 'mongodb';
import { Collection, ICollectionOptions, Model, ModelArray } from 'octonom';
export declare class MongoCollection<T extends object, TModel extends Model<T>> extends Collection<T, TModel> {
import { Collection, ICollectionOptions, IModelConstructor, Model, ModelArray } from 'octonom';
export declare class MongoCollection<TModel extends Model<TModel>> extends Collection<TModel> {
protected name: string;
protected collection: DbCollection;
constructor(name: string, model: new (data: any) => TModel, options?: ICollectionOptions);
constructor(name: string, model: IModelConstructor<TModel>, options?: ICollectionOptions);
insertMany(models: TModel[], options?: CollectionInsertManyOptions): Promise<void>;

@@ -12,3 +12,3 @@ insertOne(model: TModel): Promise<void>;

findById(id: string): Promise<TModel>;
findByIds(ids: string[]): Promise<ModelArray<T, TModel>>;
findByIds(ids: string[]): Promise<ModelArray<TModel>>;
findOne(query: object, options?: FindOneOptions): Promise<TModel>;

@@ -15,0 +15,0 @@ init(db: Db): Promise<void>;

@@ -5,3 +5,3 @@ import { cloneDeep } from 'lodash';

import { CatModel, ICat } from 'octonom/build/test/data/models/cat';
import { CatModel } from 'octonom/build/test/data/models/cat';

@@ -11,3 +11,3 @@ import { MongoCollection } from './mongo-collection';

describe('MongoCollection', () => {
class CatCollection extends MongoCollection<ICat, CatModel> {}
class CatCollection extends MongoCollection<CatModel> {}
const catObj = {id: '42', name: 'Yllim'};

@@ -14,0 +14,0 @@

import { Collection as DbCollection, CollectionInsertManyOptions, Cursor,
Db, FindOneOptions } from 'mongodb';
import { Collection, ICollectionOptions, Model, ModelArray, utils } from 'octonom';
import { Collection, ICollectionOptions, IModelConstructor, Model, ModelArray, utils } from 'octonom';
export class MongoCollection<T extends object, TModel extends Model<T>> extends Collection<T, TModel> {
export class MongoCollection<TModel extends Model<TModel>> extends Collection<TModel> {
protected collection: DbCollection;

@@ -11,3 +11,3 @@

protected name: string,
model: new (data: any) => TModel,
model: IModelConstructor<TModel>,
options: ICollectionOptions = {},

@@ -49,3 +49,3 @@ ) {

docs.forEach(doc => idInstanceMap[doc._id] = this.fromDb(doc));
return new ModelArray<T, TModel>(this.model, ids.map(id => idInstanceMap[id]));
return new ModelArray<TModel>(this.model, ids.map(id => idInstanceMap[id]));
}

@@ -52,0 +52,0 @@

{
"name": "octonom-mongodb",
"version": "1.0.0-alpha.5",
"version": "1.0.0-alpha.6",
"description": "MongoDB collection for Octonom",

@@ -28,4 +28,5 @@ "main": "build/lib/main.js",

"mongodb": "^2.2.29",
"octonom": "^1.0.0-alpha.10"
"octonom": "^1.0.0-alpha.11",
"ts-node": "^3.3.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc