jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
284 stars 64 forks source link

Cannot use quoted numbers as names with gridfs #224

Open rudolf-bauer opened 2 years ago

rudolf-bauer commented 2 years ago

Using 2.3.0 release.

This works fine:

fs = gridfs(db ='db', prefix = 'test')
data = serialize('some text', NULL)
fs$write(data, 'test', progress = FALSE,  metadata = '{"This is" : "just a test"}')
fs$read('test', con = NULL, progress = FALSE)

However, when using a number as a name, e.g. '1', '2', etc., I am getting an error:

fs$write(data, '1', progress = FALSE,  metadata = '{"This is" : "just a test"}')
fs$read('1', con = NULL, progress = FALSE)
Error: Incomplete JSON