| 150 | } // end of GetCollSize |
| 151 | |
| 152 | public boolean FindColl(String query, String fields) { |
| 153 | if (DEBUG) |
| 154 | System.out.println("FindColl: query=" + query + " fields=" + fields); |
| 155 | |
| 156 | try { |
| 157 | if (query != null || fields != null) { |
| 158 | dbq = (BasicDBObject) JSON.parse((query != null) ? query : "{}"); |
| 159 | |
| 160 | if (fields != null) { |
| 161 | dbf = (BasicDBObject) JSON.parse(fields); |
| 162 | cursor = coll.find(dbq, dbf); |
| 163 | } else |
| 164 | cursor = coll.find(dbq); |
| 165 | |
| 166 | } else |
| 167 | cursor = coll.find(); |
| 168 | |
| 169 | } catch (Exception e) { |
| 170 | SetErrmsg(e); |
| 171 | return true; |
| 172 | } // end try/catch |
| 173 | |
| 174 | return false; |
| 175 | } // end of FindColl |
| 176 | |
| 177 | @SuppressWarnings("unchecked") |
| 178 | public boolean AggregateColl(String pipeline) { |