From 7a3f0f5a4cbf1ae7145bb22ee5791bdb92884f1f Mon Sep 17 00:00:00 2001 From: Dotan Simha Date: Thu, 3 Nov 2016 12:21:10 +0200 Subject: [PATCH] bugfix(types): Fixes array type of Observable in find() --- dist/ObservableCollection.d.ts | 4 ++-- dist/ObservableCollection.js | 2 +- dist/bundles/index.umd.js | 2 +- docs/ObservableCollection.md | 6 +++--- src/ObservableCollection.ts | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dist/ObservableCollection.d.ts b/dist/ObservableCollection.d.ts index 59415e98..11c2a070 100644 --- a/dist/ObservableCollection.d.ts +++ b/dist/ObservableCollection.d.ts @@ -135,7 +135,7 @@ export declare module MongoObservable { * * @param {Collection~MongoQuerySelector} selector - A query describing the documents to find * @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc. - * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. + * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. * @example Using Angular2 Component * const MyCollection = MongoObservable.Collection("myCollection"); * @@ -156,7 +156,7 @@ export declare module MongoObservable { fields?: FieldSpecifier; reactive?: boolean; transform?: Function; - }): ObservableCursor; + }): ObservableCursor; /** * Finds the first document that matches the selector, as ordered by sort and skip options. * diff --git a/dist/ObservableCollection.js b/dist/ObservableCollection.js index 038fb080..c8a91e1c 100644 --- a/dist/ObservableCollection.js +++ b/dist/ObservableCollection.js @@ -182,7 +182,7 @@ export var MongoObservable; * * @param {Collection~MongoQuerySelector} selector - A query describing the documents to find * @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc. - * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. + * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. * @example Using Angular2 Component * const MyCollection = MongoObservable.Collection("myCollection"); * diff --git a/dist/bundles/index.umd.js b/dist/bundles/index.umd.js index f2b37ee1..10e02812 100644 --- a/dist/bundles/index.umd.js +++ b/dist/bundles/index.umd.js @@ -397,7 +397,7 @@ var ObservableCursor = (function (_super) { * * @param {Collection~MongoQuerySelector} selector - A query describing the documents to find * @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc. - * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. + * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. * @example Using Angular2 Component * const MyCollection = MongoObservable.Collection("myCollection"); * diff --git a/docs/ObservableCollection.md b/docs/ObservableCollection.md index abc78491..1e74116d 100644 --- a/docs/ObservableCollection.md +++ b/docs/ObservableCollection.md @@ -22,7 +22,7 @@ T is a generic type - should be used with the type of the objects inside the col * [.remove(selector)](#Collection+remove) ⇒ Observable.<Number> * [.update(selector, modifier, options)](#Collection+update) ⇒ Observable.<Number> * [.upsert(selector, modifier, options)](#Collection+upsert) ⇒ Observable.<{numberAffected, insertedId}> - * [.find(selector, options)](#Collection+find) ⇒ ObservableCursor.<Array.<T>> + * [.find(selector, options)](#Collection+find) ⇒ ObservableCursor.<T> * [.findOne(selector, options)](#Collection+findOne) ⇒ any * _inner_ * [~MongoQueryOptions](#Collection..MongoQueryOptions) : Object @@ -137,11 +137,11 @@ Finds the first document that matches the selector, as ordered by sort and skip -### collection.find(selector, options) ⇒ ObservableCursor.<Array.<T>> +### collection.find(selector, options) ⇒ ObservableCursor.<T> Method has the same notation as Mongo.Collection.find, only returns Observable. **Kind**: instance method of [Collection](#Collection) -**Returns**: ObservableCursor.<Array.<T>> - RxJS Observable wrapped with Meteor features. +**Returns**: ObservableCursor.<T> - RxJS Observable wrapped with Meteor features. **See**: [find on Meteor documentation](https://docs.meteor.com/api/collections.html#Mongo-Collection-find) | Param | Type | Description | diff --git a/src/ObservableCollection.ts b/src/ObservableCollection.ts index e3c76aab..4e8e642a 100644 --- a/src/ObservableCollection.ts +++ b/src/ObservableCollection.ts @@ -228,7 +228,7 @@ export module MongoObservable { * * @param {Collection~MongoQuerySelector} selector - A query describing the documents to find * @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc. - * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. + * @returns {ObservableCursor} RxJS Observable wrapped with Meteor features. * @example Using Angular2 Component * const MyCollection = MongoObservable.Collection("myCollection"); * @@ -249,10 +249,10 @@ export module MongoObservable { fields?: FieldSpecifier; reactive?: boolean; transform?: Function; - }): ObservableCursor { + }): ObservableCursor { const cursor = this._collection.find.apply( this._collection, arguments); - return ObservableCursor.create(cursor); + return ObservableCursor.create(cursor); } /**