-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Observed behavior
Kvm is defined as following:
/**
* The entry point to creating new KV instances.
*/
export declare class Kvm {
#private;
js: JetStreamClientImpl;
/**
* Creates an instance of the Kv that allows you to create and access KV stores.
* Note that if the argument is a NatsConnection, default JetStream Options are
* used. If you want to set some options, please provide a JetStreamClient instead.
* @param nc
*/
constructor(nc: JetStreamClient | NatsConnection);
/**
* Creates and opens the specified KV. If the KV already exists, it opens the existing KV.
* @param name
* @param opts
*/
create(name: string, opts?: Partial<KvOptions>): Promise<KV>;
/**
* Open to the specified KV. If the KV doesn't exist, this API will fail.
* @param name
* @param opts
*/
open(name: string, opts?: Partial<KvOptions>): Promise<KV>;
/**
* Lists all available KVs
*/
list(): Lister<KvStatus>;
}And Objm is defined as following:
export declare class Objm {
#private;
js: JetStreamClientImpl;
/**
* Creates an instance of the Objm that allows you to create and access ObjectStore.
* Note that if the argument is a NatsConnection, default JetStream Options are
* used. If you want to set some options, please provide a JetStreamClient instead.
* @param nc
*/
constructor(nc: JetStreamClient | NatsConnection);
/**
* Creates and opens the specified ObjectStore. If the ObjectStore already exists,
* it opens the existing ObjectStore.
* @param name
* @param opts
*/
create(name: string, opts?: Partial<ObjectStoreOptions>): Promise<ObjectStore>;
/**
* Opens the specified ObjectStore
* @param name
* @param check - if set to false, it will not check if the ObjectStore exists.
*/
open(name: string, check?: boolean): Promise<ObjectStore>;
/**
* Returns a list of ObjectStoreStatus for all streams that are identified as
* being a ObjectStore (that is having names that have the prefix `OBJ_`)
*/
list(): Lister<ObjectStoreStatus>;
}Here I conclude that Kvm.open accepts parameters that only serve a need on creation, not at opening.
Expected behavior
Kvm.openandObjm.opento be consistent- Both to have the
checkparameter that will check if the store / bucket exists.
Server and client version
"@nats-io/jetstream": "^3.0.0-40",
"@nats-io/kv": "^3.0.0-34",
"@nats-io/nats-core": "^3.0.0-54",
"@nats-io/obj": "^3.0.0-36",
"@nats-io/transport-node": "^3.0.0-38",
Host environment
No response
Steps to reproduce
No response
karladler
Metadata
Metadata
Assignees
Labels
No labels