-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
a few typescript errors after upgrading to 6.0.0 #10601
Comments
|
I'm seeing a new typescript error from v6 as well when using it with react-hook-forms. Type error: Type of property '_id' circularly references itself in mapped type '{ [K in keyof ObjectId]-?: PathImpl<K & string, ObjectId[K]>; }'.
|
thanks .. on
thanks |
|
I cannot find any documentaito abou tit, but it seems the return values of updateOne and co have changed? |
@simllll correct. Those are changes in v4.0.0 of the MongoDB node driver. We will add a note about those to our migration guide. |
Ah thanks, if someone stumples upon this, update returns now somehting like this: |
@huineng regarding (2), the below script compiles fine, no issues. Can you please modify the below script to demonstrate the compiler failure you're seeing? import { connect, model, Schema } from 'mongoose';
run().catch(err => console.log(err));
async function run() {
await connect('mongodb://localhost:27017/test');
interface IJobLog {
testProp?: string;
}
const schema = new Schema<IJobLog>({ testProp: String });
const JobLogModel = model<IJobLog>('Test', schema);
const docs: IJobLog[] = await JobLogModel.find({})
.skip(0)
.limit(0)
.sort({ jobstart: -1 })
.lean()
.exec();
console.log(docs);
} |
Thanks, i should have done my update separately and not editing my previous comment. But indeed it's working again. It even helped me to clean up the code a bit. It happened when my interface (in your case IJobLog) is not the same as the schema (i had a few more elements in my interface then in my schema). Aligning interface with schema fixed it. Sorry for that. I'm all good. Just the issue with the different versions, but that will be solved 2 |
I upgraded today to v 6 and had to clean up a few things
even the mongoose.set('useFindAndModify', false); does not work anymore
so i removed this option completely
error
client
doesn't work with mongoose in TypeScript jdesboeufs/connect-mongo#433 but not sure which library should cover thisEverything is still working, i have no need to revert back but eventually i would like to get rid of my ts ignores
thanks
The text was updated successfully, but these errors were encountered: