MCPcopy Create free account
hub / github.com/adonisjs/session / increment

Method increment

src/session.ts:378–380  ·  view source on GitHub ↗

* Increments the value of a key inside the session store. * A new key will be defined if it doesn't exist already with value 1. * * @param key - The key to increment * @param steps - Number of steps to increment (default: 1) * * @example * session.increment('page_views') //

(key: string, steps: number = 1)

Source from the content-addressed store, hash-verified

376 * session.increment('score', 10) // Increments by 10
377 */
378 increment(key: string, steps: number = 1) {
379 return this.#getValuesStore('write').increment(key, steps)
380 }
381
382 /**
383 * Decrements the value of a key inside the session store.

Callers 3

session.spec.tsFile · 0.45
api_client.spec.tsFile · 0.45

Calls 1

#getValuesStoreMethod · 0.95

Tested by

no test coverage detected