If I have the below code for inserting data in using mongodb, how can I update it's value. I'm confuse with the setting of arguments in update_one/update_many function.
require 'mongo'
require 'json/ext'
client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'myDB')
client[:test_table].insert_many([
{
:last_date=> Time.now.strftime("%Y%m%d"),
:morning_time=> "test",
:day1_fullDate=> "test"
}
])
I failed to do the update function. Please help!
SOLVED
I found out that the MongoDB syntax needs to change a little bit depends on what programming language you are using.
For example, in my side I'm using ruby and needs a bit adjustments with the code given in Main Documentation (e.g. https://docs.mongodb.org/manual/reference/method/db.collection.update/#update-parameter)