MongoDB java driver how to add arrays whith mixed data types
问题 I am trouble because I want to increment a date object in 1 hour, with the java driver , this is: {"tDate":{$add: ["$tDate", 3600*1000]} making, wont work because mongoDB expects a number and receives a string String [] date_add_array = {"$t_tDate", String.valueOf(3600*1000) }; BasicDBObject query_component = new BasicDBObject("tDate", new BasicDBObject("$add", date_add_array)) >exception: $add only supports numeric or date types, not String Using a BasicDBList object list won't work, because