sonarFind: Run a saved find query

Description Usage Arguments Details See Also Examples

View source: R/sonarFind.R

Description

Execute a find query which has been saved and published in JSON Studio Finder, and get the result in a data frame.

Usage

1
2
sonarFind(connection, queryName, queryCol, bind = list(), limit = NULL,
  idCol = "_id", publishedBy = NULL, colClasses = NA)

Arguments

connection

a SonarConnection object created with new.SonarConnection

queryName

the name of the saved query to execute

queryCol

a collection in the database to use with the query

bind

a list of bind variables and their values

limit

the maximum number of results to return

idCol

the name of a field which uniquely identifies each document. This will be used for the row names in the returned data frame. The default is X_id, which is the name of Mongo's _id field (adjusted by make.names).

publishedBy

the name of the user who we expect published the API

colClasses

a list of column names and their respective classes, as used in read.csv. This may be necessary if some columns' types are not being detected automatically.

Details

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

Other connection: new.SonarConnection; sonarAgg; sonarCSV; sonarJSON

Other csv: sonarAgg; sonarCSV

Examples

1
2
3
4
5
6
7
8
9
connection <- new.SonarConnection('https://example.com', 'localhost', 'test')

delays <- sonarFind(connection, 'delayed_flights', 'WAFlights')
cor(delays$ACTUAL_ELAPSED_TIME, delays$WEATHER_DELAY)

tx_to_co <- sonarFind(connection, 'flights_to', 'TXFlights',
  bind=list(state="CO"),
  colClasses=c(DAY_OF_MONTH='factor', DEST_AIRPORT_ID='factor'))
hist(tx_to_co$ACTUAL_ELAPSED_TIME)

jSonarR documentation built on May 30, 2017, 8:16 a.m.