DBObject
DBObject obj = new BasicDBObject(); obj.put( "foo", "bar" );
6566676869707172737475
@Override public List<Dashboard> all() { List<Dashboard> dashboards = Lists.newArrayList(); List<DBObject> results = query(DashboardImpl.class, new BasicDBObject()); for (DBObject o : results) { Map<String, Object> fields = o.toMap(); Dashboard dashboard = new DashboardImpl((ObjectId) o.get("_id"), fields); // Add all widgets of this dashboard.
3637383940414243444546474849
@Override public List<SystemMessage> all(int page) { List<SystemMessage> messages = Lists.newArrayList(); DBObject sort = new BasicDBObject(); sort.put("timestamp", -1); List<DBObject> results = query(SystemMessageImpl.class, new BasicDBObject(), sort, PER_PAGE, PER_PAGE * page); for (DBObject o : results) { messages.add(new SystemMessageImpl(new ObjectId(o.get("_id").toString()), o.toMap())); } return messages;