import java.util.Date;
import com.mongodb.BasicDBObject;
public class MongoDB {
public static void main(String[] args) {
BasicDBObject document = new BasicDBObject();
document.put("userName", "mungeol");
document.put("developer", true);
document.put("age", 29);
document.put("languages", Arrays.asList("C", "Java"));
document.put(
"address",
new BasicDBObject("street", "20 Main").append("town",
"Westfield").append("zip", 12345));
document.put("registerDate", new Date());
System.out.println(document);
}
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.