0

I'm trying to run mongoexport using this query:

mongoexport --db=database --username=user --password=pass --collection=coll --type=csv --fields=Name --query='{ "Date" : { "$gte" : { "$date" : "2023-03-01T00:00:00.000Z" } }' --out /files/export.csv

But i'm getting this error message:

query '[123 32 34 80 114 111 99 101 115 115 111 46 78 111 109 101 34 32 58 32 34 80 82 67 95 68 65 84 65 95 81 85 65 76 73 84 89 34 44 34 80 114 111 99 101 115 115 111 46 69 116 97 112 97 46 78 111 109 101 34 32 58 32 34 69 48 53 95 82 69 76 65 67 73 79 78 65 77 95 84 82 65 84 65 77 34 44 34 80 114 111 99 101 115 115 111 46 69 116 97 112 97 46 68 97 116 97 73 110 105 99 105 111 34 32 58 32 123 32 34 36 103 116 101 34 32 58 32 123 32 34 36 100 97 116 101 34 32 58 32 73 83 79 68 97 116 101 40 34 50 48 50 51 45 48 51 45 48 49 84 48 48 58 48 48 58 48 48 46 48 48 48 90 34 41 32 125 32 125]' is not valid JSON: unexpected end of JSON input

Is there something wrong with the way I use the date format? I built this query following the answer here, but still no success.

1
  • 1
    That array is list of character codes, making the string: { "Processo.Nome" : "PRC_DATA_QUALITY","Processo.Etapa.Nome" : "E05_RELACIONAM_TRATAM","Processo.Etapa.DataInicio" : { "$gte" : { "$date" : ISODate("2023-03-01T00:00:00.000Z") } }, which is not valid JSON, and doesn't look like the query you show.
    – Joe
    Mar 30 at 20:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.