In mongosh
% mongosh
Current Mongosh Log ID: 630639411fcf560da1e8d627
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.5.4
Using MongoDB: 6.0.1
Using Mongosh: 1.5.4
I am getting the error
test> printjsononline({teste : 1})
ReferenceError: printjsononline is not defined
But it used to work in mongo
tool, before it was upgraded to mongosh
. What did that function? How to replace it? This is used by an emacs mode (http://github.com/own-pt/sensetion.el) that I need to use.
2
Answers
As mentioned in the
Mongosh
documentation:I don’t think the support for
printjsononline
is added yet. However, you can tryprintjson
method ofmongosh
, if it works the same.Check this list to find all the methods supported by mongosh.
Most functions which are removed in new
mongosh
are provided by the mongosh-snippets package in Github.Or write your own function: