An object that you pass as the options parameter that modifies how an operation is performed. Unlike WeivDataOptions this type has cache control over the action.

interface WeivDataOptionsCache {
    cacheTimeout?: number;
    convertIds?: boolean;
    enableCache?: boolean;
    readConcern?:
        | "local"
        | "majority"
        | "linearizable"
        | "available"
        | "snapshot";
    suppressAuth?: boolean;
    suppressHooks?: boolean;
}

Hierarchy (view full)

Properties

cacheTimeout?: number

Set a custom cache timeout to specify a time of expiration for cached data. (Anything above 6 min won't work since Wix website containers don't live longer than 6min)

convertIds?: boolean

When enabled we will convert all _id fields from ObjectId to String, if they are not in ObjectId type then we won't touch them. If not enabled we will return _id fields without modification.

enableCache?: boolean

Enable or disable the cache for the current function.

readConcern?:
    | "local"
    | "majority"
    | "linearizable"
    | "available"
    | "snapshot"

An option to choose a consistency level when reading data from MongoDB Clusters.

suppressAuth?: boolean

An option to bypass permissions and perform operations in admin level.

suppressHooks?: boolean

An option to bypass all hooks (before or after hooks) that runs for the function.