-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added typescript type definitions for typescript and fixes Model.distinct() (close #52) #63
base: master
Are you sure you want to change the base?
Conversation
Need it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xrip It showing me this error after taken your pull request
TS2551: Property 'cache' does not exist on type 'DocumentQuery<IUser, IUser, {}>'. Did you mean 'catch'
@Akhil-bridge Did you extends global mongoose object with cache goose? Like import mongoose from 'mongoose';
import cachegoose from 'cachegoose';
import redis from '../redis';
const mongo = function mongo(config: string): mongoose.Connection {
const options = {
useUnifiedTopology: true,
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false,
};
mongoose.connect(config, options);
cachegoose(mongoose, redis);
return mongoose.connection;
};
export default mongo(process.env.MONGODB as string); Looks like your IDE resolves not extended type definition by cachegoose |
Thanks xrip |
Could you please merge this @boblauer ? |
@xrip do you know how to keep node_modules updated with the changes in the forked repo? I don't think these changes been merged soon. |
You can add package directly from my github repo e.g |
@xrip I seem to get a bunch of build errors when trying to use your repo.
|
Those little fixes would be very useful for community.
I've using chachegoose with typescript for a long time and want to share my definitions for community. Also, here is some fix for .distinct operation which not needs an hydrate it works like .lean