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

Types: Property 'project' does not exist on type 'Aggregate<...>'. #10043

Closed
stgogm opened this issue Mar 19, 2021 · 2 comments
Closed

Types: Property 'project' does not exist on type 'Aggregate<...>'. #10043

stgogm opened this issue Mar 19, 2021 · 2 comments
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@stgogm
Copy link

stgogm commented Mar 19, 2021

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

The project method is missing from the Aggregate interface.

If the current behavior is a bug, please provide the steps to reproduce.

import { createConnection } from 'mongoose';

const db = createConnection();
const aggregateResults = await db
  .model('SomeModel')
  .aggregate<SomeModelDocument>()
  .project({ // <<-- Not recognized
    someField: true
  });
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "ES2019",
    "rootDir": "./src",
    "outDir": "./lib",
    "declaration": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "lib": ["ES2019"]
  },
  "include": ["src/**/*", "test.ts"],
  "exclude": ["node_modules", "**/*.spec.ts"]
}

What is the expected behavior?

The project method does indeed exists in the aggregate class.

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.

Node v14.16.0
Mongoose v5.12.1
MongoDB v4.0.14 in-memory test
@vkarpov15 vkarpov15 added this to the 5.12.2 milestone Mar 20, 2021
@vkarpov15 vkarpov15 added the typescript Types or Types-test related issue / Pull Request label Mar 20, 2021
@jerkly
Copy link

jerkly commented Mar 22, 2021

c2f90f2

@vkarpov15
Copy link
Collaborator

Looks like this got unintentionally removed by a31efa1#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8. Will be added back in 5.12.2, sorry for the inconvenience! 👍

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