arcdb
v5.0.2
Published
Arc Database is a simple, flexible and cross-platform database library for Node.js. Suitable for all types of use, Arc Database is easily integrated and offers a wide range of functionality.
Downloads
10
Maintainers
Readme
Arch Database
Arc Database is a simple, flexible and cross-platform database library for Node.js. Suitable for all types of use, Arc Database is easily integrated and offers a wide range of functionality.
SETUP
En son Node.js sürümü gereklidir.
npm install arcdb
USE
const data = require('arcdb');
EXAMPLE
set(key, value): Sets a value in the database for the specified key.
get(key): Retrieves the value associated with the specified key from the database.
delete(key): Deletes the specified key and its associated value from the database.
list(): Returns an object containing all key-value pairs stored in the database.
clear(): Clears all data in the database.
exists(key): Checks whether the specified key exists in the database.
update(key, value): Updates the value for the specified key in the database.
count(): Returns the number of key-value pairs stored in the database.
keyList(): Returns an array containing all keys stored in the database.
values(): Returns an array containing all values stored in the database.
bulkSet(keyValuePairs): Sets multiple key-value pairs in the database at once.
backup(): Creates a backup of the database.
backupClean(daysOld): Cleans up backup files older than the specified number of days.
export(exportPath): Exports the database to the specified path.
import(importPath): Imports data from the specified file into the database.
startTransaction(): Begins a transaction, allowing multiple operations to be performed atomically.
addToTransaction(key, value): Adds a key-value pair to the current transaction.
commitTransaction(): Commits the current transaction, applying changes to the database.
rollbackTransaction(): Rolls back the current transaction, canceling any pending changes.
search(query): Searches the database for key-value pairs matching the specified query.
backupRestore(backupFileName): Restores the database from the specified backup file.
customPathBackup(backupDir): Creates a custom backup file in the specified directory.
customPathExport(exportPath): Exports the database to a custom path.
reset(): Resets the database, clearing all data.
partialUpdate(key, partialValue): Partially updates the value for the specified key.
keyExists(key): Checks whether the specified key exists in the database.
valueExists(value): Checks whether the specified value exists in the database.
size(): Returns the number of key-value pairs stored in the database.
conditionalSet(key, value, condition): Sets a key's value if a condition is met.
increment(key, amount = 1): Increments the value for the specified key.
decrement(key, amount = 1): Decrements the value for the specified key.
valueTypeCheck(key, type): Checks if the value for the specified key is of the specified type.
deepCopy(): Creates a deep copy of the database.
isSubsetOf(subset): Checks if the database is a subset of the specified subset.
merge(otherDB): Merges another database into the current database.
removeValue(value): Removes all key-value pairs with the specified value from the database.
randomKey(): Returns a random key from the database.
transformKeys(transformFunc): Transforms all keys according to the specified transformation function.
filter(filterFunc): Filters the database based on the specified filter function.
sort(compareFunc): Sorts the database based on the specified comparison function.
convertKeyCase(caseType): Converts all keys to uppercase or lowercase.
uniqueValues(): Returns unique values in the database.
keyDifference(otherDB): Returns keys in the current database that are not in the other database.
reverse(): Reverses the database, swapping keys and values.
addKeyPrefix(prefix): Creates a new database with all keys prefixed with the specified prefix.
addKeySuffix(suffix): Creates a new database with all keys suffixed with the specified suffix.
trimValues(): Trims leading and trailing whitespace from all values.
capitalizeValues(): Capitalizes the first letter of all values.
filterByValue(value): Filters key-value pairs by the specified value.
map(mapFunc): Applies the specified function to each key-value pair in the database.
uniqueKeys(): Returns unique keys in the database.
filterByKey(key): Filters key-value pairs by the specified key.
keyUnion(otherDB): Returns the union of the current database and another database.
keyIntersection(otherDB): Returns the intersection of the current database and another database.
symmetricKeyDifference(otherDB): Returns the symmetric difference between the current database and another database.
listKeysWithPrefix(prefix): Returns all keys with the specified prefix.
listKeysWithSuffix(suffix): Returns all keys with the specified suffix.
invert(): Inverts key-value pairs, swapping keys and values.
mapValues(mapFunc): Applies the specified function to each value in the database.
valuesToKeys(): Converts all values to keys and keys to values.
keysToValues(): Converts all keys to values and values to keys.
keyFrequency(): Calculates the frequency of each key in the database.
mergeSubset(subsetDB): Merges the current database with a specified subset database.
filterByKeyLength(length): Returns keys of the specified length.
uniqueKeyPrefix(prefix): Generates a unique prefix for keys in the database.
objectValueSearch(value): Returns key-value pairs with objects containing the specified value.
validateKeyFormat(formatRegex): Validates that all keys match a specified regex pattern.
exportToCSV(filePath): Exports the database to a CSV file.
importFromCSV(filePath): Imports data from a CSV file into the database.
randomValue(): Returns a random value from the database.
checkValueType(value, type): Checks if the specified value is of the specified type.
deepMerge(obj1, obj2): Deeply merges two objects.
convertKeyFormat(convertFunc): Converts all keys according to the specified conversion function.
swapKeyValuePairs(): Swaps key-value pairs.
shuffleKeys(): Shuffles keys randomly.
shuffleValues(): Shuffles values randomly.
keyOccurrenceCount(): Counts the occurrences of each key in the database.
addKeyValuePairs(keyValuePairs): Adds the specified key-value pairs to the database.
removeKeyValuePairs(keys): Removes the specified keys and their associated values from the database.
updateKeyValuePairs(keyValuePairs): Updates the values of the specified key-value pairs.
subsetDifference(subset): Returns the difference between the current database and a specified subset.
convertValuesType(type): Converts all values in the database to the specified type.
deepClone(obj): Creates a deep clone of an object.
groupByKeys(groupingFunc): Groups keys according to the specified grouping function.
groupByValues(groupingFunc): Groups values according to the specified grouping function.