Skip to content
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

model as key not allowed anymore #11629

Closed
simllll opened this issue Apr 5, 2022 · 0 comments
Closed

model as key not allowed anymore #11629

simllll opened this issue Apr 5, 2022 · 0 comments
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@simllll
Copy link
Contributor

simllll commented Apr 5, 2022

This commit causes some troubles on my side: 90e696c

I have a model like this:
image
image

The problem here is that I have a prop called "model" in IFileUsedBy, but this is now excluded.

const fileRef = await this.StorageFileModel.findOneAndUpdate(
			{ name, container },
			{
				$setOnInsert: {
					created: new Date()
				}
			},
			{ returnDocument: 'after', upsert: true }
		)
			.lean()
			.exec();

		return fileRef; <-- should be a match to an IStorageFile
Error: src/database/StorageFileRepository.ts(19,3): error TS2322: Type 'LeanDocument<IDBStorageFile & { _id: any; }>[]' is not assignable to type 'IStorageFile[]'.
  Type 'LeanDocument<IDBStorageFile & { _id: any; }>' is not assignable to type 'IStorageFile'.
    Types of property 'usedBy' are incompatible.
      Type 'LeanDocument<IFileUsedBy>[]' is not assignable to type 'IFileUsedBy[]'.
        Property 'model' is missing in type 'LeanDocument<IFileUsedBy>' but required in type 'IFileUsedBy'.

@IslandRhythms IslandRhythms added the typescript Types or Types-test related issue / Pull Request label Apr 5, 2022
@vkarpov15 vkarpov15 added this to the 6.2.12 milestone Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

No branches or pull requests

3 participants