less than 1 minute read

mongodb objectid 형변환

objectid To string

import org.bson.types.ObjectId;
ObjectId idObj = (ObjectId)obj.get("_id");
String id = idObj.toString()

string to objectid

ObjectId oId = new ObjectId(“string”);

Categories:

Updated: