bwgjoseph / mongoose-vs-ottoman

feature comparison between mongoose and ottoman
0 stars 1 forks source link

difference between FindOptions and IFindOptions #99

Closed bwgjoseph closed 3 years ago

bwgjoseph commented 3 years ago

Hi,

As I was looking into #98, I noticed that there's FindOptions and IFindOptions declared as such

export declare class FindOptions {
    skip?: number;
    limit?: number;
    sort?: Record<string, SortType>;
    populate?: PopulateFieldsType;
    populateMaxDeep?: number;
    select?: ISelectType[] | string | string[];
    consistency?: SearchConsistency;
    noCollection?: boolean;
    lean?: boolean;
    ignoreCase?: boolean;
    constructor(data: FindOptions);
}
export interface IFindOptions {
    skip?: number;
    limit?: number;
    sort?: Record<string, SortType>;
    populate?: string | string[];
    populateMaxDeep?: number;
    select?: ISelectType[] | string | string[];
    consistency?: SearchConsistency;
    noCollection?: boolean;
    lean?: boolean;
    ignoreCase?: boolean;
}

In particular, the populate is declared differently where one is declared with PopulateFieldsType and another string | string[]. I understand one is class and another is interface but why the difference in the declaration in populate field? where string | string[] is also declared as FieldsBaseType in populate.types

Thanks

AV25242 commented 3 years ago

Have asked the team, will let you know.

AV25242 commented 3 years ago

This should be fixed with next release.