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

expireAfterSeconds schema option not valid and not effective on timeseries collection #11229

Closed
ghost opened this issue Jan 16, 2022 · 1 comment · Fixed by #11489
Closed
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@ghost
Copy link

ghost commented Jan 16, 2022

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

What is the current behavior?
I use moongose for create timeseries collection
my schema is like this :

const schema = new mongoose.Schema({ timestamp: Date, metadata: metricMetadataSchema },
  {
    _id: false,
    strict: false,
    autoIndex: false,
    autoCreate: false,
    timeseries: {timeField: "timestamp", metaField: "metadata", granularity: 'minutes'},
    // @ts-ignore
    expireAfterSeconds: 60
  }
)

At this point the property expireAfterSeconds is not valid for typescript because expireAfterSeconds not include in type SchemaOptions
The collection is well done created, but no info about expireAfterSeconds anywhere and after 60 seconds data not removed.

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

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2017",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true
  }
}

What is the expected behavior?

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
node: v14.17.0
mongodb: 4.3.0
mongoose: 6.1.6

@vkarpov15 vkarpov15 added this to the 6.1.10 milestone Jan 17, 2022
@vkarpov15 vkarpov15 added the typescript Types or Types-test related issue / Pull Request label Jan 17, 2022
@vkarpov15 vkarpov15 modified the milestones: 6.2.3, 6.2.6 Feb 16, 2022
@Uzlopak
Copy link
Collaborator

Uzlopak commented Mar 6, 2022

Ok, should be fixed with #11489

@vkarpov15 vkarpov15 reopened this Mar 11, 2022
@vkarpov15 vkarpov15 modified the milestones: 6.2.6, 6.2.7 Mar 11, 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

Successfully merging a pull request may close this issue.

2 participants