xpress-mongo
Advanced tools
Comparing version 0.0.23 to 0.0.24
{ | ||
"name": "xpress-mongo", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "Light Weight ODM for mongoDb", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
@@ -14,3 +14,3 @@ import ObjectCollection = require('object-collection'); | ||
CollectionInsertOneOptions, | ||
CollectionAggregationOptions | ||
CollectionAggregationOptions, AggregationCursor | ||
} from 'mongodb'; | ||
@@ -28,3 +28,3 @@ | ||
type FunctionWithRawArgument = { (raw: Collection): Cursor }; | ||
type FunctionWithRawArgument = { (raw: Collection): Cursor | AggregationCursor }; | ||
@@ -375,3 +375,3 @@ | ||
*/ | ||
update(set: StringToAnyObject, options: UpdateOneOptions): Promise<UpdateWriteOpResult> { | ||
update(set: StringToAnyObject, options?: UpdateOneOptions): Promise<UpdateWriteOpResult> { | ||
if (!this.id()) throw "UPDATE_ERROR: Model does not have an _id, so we assume it is not from the database."; | ||
@@ -675,3 +675,3 @@ return <Promise<UpdateWriteOpResult>>this.set(set).save(options) | ||
*/ | ||
async hasOne(relationship: string, extend: StringToAnyObject = {}): Promise<StringToAnyObject | XMongoModel> { | ||
async hasOne(relationship: string, extend: StringToAnyObject = {}): Promise<any | XMongoModel> { | ||
let config = (<typeof XMongoModel>this.constructor).relationships; | ||
@@ -678,0 +678,0 @@ |
import ObjectCollection = require('object-collection'); | ||
import { ObjectID, Collection, UpdateWriteOpResult, InsertOneWriteOpResult, DeleteWriteOpResultObject, Cursor, FindOneOptions, UpdateOneOptions, CollectionInsertOneOptions, CollectionAggregationOptions } from 'mongodb'; | ||
import { ObjectID, Collection, UpdateWriteOpResult, InsertOneWriteOpResult, DeleteWriteOpResultObject, Cursor, FindOneOptions, UpdateOneOptions, CollectionInsertOneOptions, CollectionAggregationOptions, AggregationCursor } from 'mongodb'; | ||
import { XMongoSchemaBuilder } from './XMongoSchemaBuilder'; | ||
import { PaginationData, StringToAnyObject } from "./CustomTypes"; | ||
declare type FunctionWithRawArgument = { | ||
(raw: Collection): Cursor; | ||
(raw: Collection): Cursor | AggregationCursor; | ||
}; | ||
@@ -157,3 +157,3 @@ /** | ||
*/ | ||
update(set: StringToAnyObject, options: UpdateOneOptions): Promise<UpdateWriteOpResult>; | ||
update(set: StringToAnyObject, options?: UpdateOneOptions): Promise<UpdateWriteOpResult>; | ||
/** | ||
@@ -200,3 +200,3 @@ * Create Model if not id is missing or save document if id is found. | ||
*/ | ||
hasOne(relationship: string, extend?: StringToAnyObject): Promise<StringToAnyObject | XMongoModel>; | ||
hasOne(relationship: string, extend?: StringToAnyObject): Promise<any | XMongoModel>; | ||
/** | ||
@@ -203,0 +203,0 @@ * @private |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121048