bwgjoseph / mongoose-vs-ottoman

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

return type of model and getModel #74

Closed bwgjoseph closed 3 years ago

bwgjoseph commented 3 years ago

Hi,

The return type of model and getModel is slightly different

export declare const getModel: (name: string) => Model<any, any> & (new (data: any, options?: CastOptions | undefined) => any);

export declare const model: <T = any>(name: string, schema: Schema | Record<string, unknown>, options?: any) => import("..").ModelTypes<T>;

Should it be the same? returning ModelTypes? The definition also seems slightly different, I'm not quite sure though

I face issue while trying to get back the type

// can be any or ModelTypes
const postModel = getModel(modelName) || model(modelName, schema, modelOptions);

export default postModel;
AV25242 commented 3 years ago

Created an Investigation ticket https://github.com/couchbaselabs/node-ottoman/issues/467

AV25242 commented 3 years ago

Will be done in the next release.

httpJunkie commented 3 years ago

Fixed w/ alpha 29