I created a MongoDB text index using R programming.
library(mongolite)
library(jsonlite)
mn <- mongo(collection = "collname", db = "dbname", url = "mongodb://localhost:27017" )
mn$index(toJSON(list("title" = "text"), auto_unbox = TRUE))
I am trying to do MongoDB text search in R for the below code.
mn$find(toJSON(list("$text" = list("$search" = "STORAGE")), auto_unbox = TRUE))
But, I got an output as "data frame with 0 columns and 0 rows". How, do I do it for proper output?
It's hard to find your error without seeing your data.
However, this example works for me
Similarly, constructing the JSON query from a list also works