Learn R Programming

jSonarR (version 1.0)

new.SonarConnection: JSON Studio connection

Description

Create a connection to a Mongo database through JSON Studio

Usage

new.SonarConnection(url, host, db, port = 27017, username = NULL,
  pwd = NULL, sdb = NULL, ssl = FALSE, anyCert = FALSE, krb = FALSE,
  mapCredentials = FALSE, secondaryPref = FALSE)

Arguments

url
the url where JSON Studio can be accessed
host
the hostname of the Mongo server, as it would be entered from the JSON Studio login screen
db
the name of the database you intend to access
port
the port number where Mongo is running
username
a username to log in to the database, if necessary
pwd
a password to log in to the database, if necessary
sdb
the name of a database to store JSON Studio-related collections
ssl
TRUE to connect using SSL
anyCert
TRUE to accept any SSL certificate
krb
TRUE to authenticate using Kerberos
mapCredentials
TRUE to map credentials to a functional user account with which to access data
secondaryPref
TRUE to allow connecting to a secondary of a replica set and prefer a secondary if the host value passed in is a replica set

Value

  • A SonarConnection object to connect to the given Mongo database through JSON Studio, which can be used with sonarFind or sonarAgg.

Details

This function returns a SonarConnection object which can be used with sonarFind and sonarAgg to query a Mongo database.

The parameters for this function are explained in greater detail in the JSON Studio help page Using the Gateway.

See Also

http://jsonstudio.com/wp-content/uploads/2014/04/manual141/_build/html/index.html

Examples

Run this code
con <- new.SonarConnection('https://localhost:8443', 'localhost', 'test')

Run the code above in your browser using DataLab