PeakDB
  • Introduction
  • Quick Start
  • Change Log
  • Reference
    • Bitwise Permission Flags
    • Supported Node.js Versions
    • NPM
    • GitHub
  • Constructors
    • Server
    • Connection
    • Collection
  • Classes
    • Collection
      • createBackup
      • loadBackup
      • drop
    • DocumentBasedCollection
      • insert
      • find
      • filter
      • has
      • update
      • archive
      • unarchive
      • delete
    • KeyValueBasedCollection
      • set
      • get
      • push
      • remove
      • find
      • filter
      • has
      • increase
      • decrease
      • delete
Powered by GitBook
On this page
  1. Constructors

Connection

Connect to a remote server.

new Connection(options)

Create a server to be able to connect remotely.

Parameter
Default
Description

options

options.address

options.authorization

options.authorization.username

options.authorization.password

options.auto_reconnect

true

options.auto_reconnect_interval

5

Example:

const example_connection = new <PeakDB>.Connection({
  "address": "127.0.0.1:4951",
  "authorization": {
    "username": "fir4tozden",
    "password": "ZdJuTNqUXpqNrw2H"
  },
  "auto_reconnect": true,
  "auto_reconnect_interval": 5
});
PreviousServerNextCollection

Last updated 3 years ago

(optional) Connection options.

The address of the server to connect to.

Your authorization settings to authenticate yourself on the server side.

Username in the list of users specified in the server option.

Password in the list of users specified in the server option.

(optional) Whether to auto-reconnect when disconnected.

(optional) Interval of seconds it will try to reconnect after disconnection.

Object
String
String
String
String
Boolean
Number