buildRegexQuery: buildRegexQuery

Description Usage Arguments Value Examples

Description

Builds a regular expression query for mongoDB in json format, for the fields "entitites.hashtags.text" and "text". Can be use in conjunction with a time interval.

Usage

1
2
buildRegexQuery(regex, timestamp, fields = c("entitites.hashtags.text",
  "text"), regexoption = "i", conjunction = "$or")

Arguments

regex

the regular expression

timestamp

to retrieve hits only within a given interval

fields

to be searched by the regex. Default "text" and "entitites.hashtags.text".

regexoption

options used for the regex. Default is "i", case insensitivity.

conjunction

used to link the regex. Can only be "$and" or "$or". Default is "$or".

Value

query in jsonformat for mongolite

Examples

1
2
3
4
5
#buildRegexQuery(c("koln","koeln","berlin"), timestamp = getInterval(
#inputinterval = c("2016-01-04 18:37:43 CET","2016-01-05 18:37:43 CET")))

#hometimeline$find(buildRegexQuery(c("koln","koeln"),timestamp = getInterval(60*24)),
#getMongoFields(c("text","entitites.hashtags.text")))

ProjectTw/TwitteR2Mongo documentation built on May 8, 2019, 3:44 a.m.