Disable the creation of new versions when modify node using Node Lib


#1

Enonic version: 7.2.0
OS: Linux Mint 19.3

I need change a field a lot of times in some nodes, but the old versions is not important for me.
Can I modify a node using Node lib, and prevent the store of new versions?
I only call the modify and all time that this run, the Enonic create a new version.

var repo = nodeLib.connect({
  repoId: 'myrepo',
  branch: 'master',
  principals: ['role:system.admin']
})

repo.modify({
  key: content._id,
  editor: editorFn
})

#2

Hi!
This is not possible. The reasons are several, one of them is that XP uses the versionID when comparing nodes across branches.

My question is, why do you want this capability?
Is it related to saving disk space or similar?


#3

I want this because my nodes have a count field, that change several times.
For example, I have 10.000 nodes that have 5 million of versions. I have some timeouts in my server, and I suspect that this big quantity of versions are the cause.

You have any suggestion to solve this? Maybe is possible delete these versions programmatically?


#4

Indeed. The vacuum function will automatically clean away unused versions with a certain age. It is currently not automatic though. We are working to automate it in our Cloud.


#5

I understand. Thanks for answer.