question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

custom location of versionKey

See original GitHub issue

Do you want to request a feature or report a bug? Not sure, I think it’s a feature request.

What is the current behavior? Consider the following schema option:

const baseSchemaOptionsJson = {
    optimisticConcurrency: true,
    versionKey: 'meta.documentVersion',
    timestamps: {
        createdAt: 'meta.createdAt',
        updatedAt: 'meta.updatedAt',
    },
};

The timestamps are moved to the meta property, but the versionKey is not. So the version key is in {…, ‘meta.documentVersion’}.

What is the expected behavior? Expecting to find the version key in {…, meta:{documentVersion:4, …}, …}

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that “latest” is not a version. node 16.18.0 mongoose 6.0.12 mongodb 4.4.10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
vkarpov15commented, Nov 18, 2021

This is a good idea, we will work on this for a future release.

0reactions
pate313373commented, Jan 19, 2022

Cool, thank you so much! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the "__v" field in Mongoose - Stack Overflow
The versionKey is a property set on each document when first created by Mongoose. This keys value contains the internal revision of the...
Read more >
Mongoose v6.8.2: Schemas
We may also define our own custom document instance methods. ... With mongoose, we define these indexes within our Schema at the path...
Read more >
Version Key :: Antora Docs
A version is resolved from the version key in a component version descriptor ... See Customize the Display Version to learn how to...
Read more >
Head Markup | LWR Sites for Experience Cloud | Salesforce ...
Custom URL Paths for Unauthenticated Sites ... Create a Multilingual LWR Site ... Every time the site is republished, the versionKey changes.
Read more >
No 'version' key in the manifest file for custom integration ( HA ...
Since last update HA 2021.3.0 I see those errors. Maybe this is new and all custom integrations must update their manifest file, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found