0

mongodb クエリはdb.test.find({"col1":{"$ne":""}}).count() です。解決策を見つけるために多くのソースを試しました。「col1」はリスト配列から入力する必要があります、コードの一部を貼り付けたので、助けてください

`

List<String> likey = new ArrayList<String>();

for (DBObject o : out.results())
{
likey.add(o.get("_id").toString()); 
}

Iterator<String>itkey = likey.iterator();

DBCursor cursor ;

//cursor = table.find();

HashMap<String, String> hashmap = new HashMap<String, String>();

while (itkey.hasNext())
{
System.out.println((String)itkey.next());

String keys = itkey.next().toString();

//System.out.println("keys --> "+keys);

String nullvalue = "";

Boolean listone = table.distinct(keys).contains(nullvalue);


hashmap.put(keys, listone.toString());

//System.out.println("distinct --> "+keys+" "+listone);

//System.out.println("proper str --- >"+ '"'+keys+'"'); 
}

Iterator<String> keyIterator = hashmap.keySet().iterator();
Iterator<String> valueIterator = hashmap.values().iterator();

while (keyIterator.hasNext()) {
//System.out.println("key: " + keyIterator.next());


while (valueIterator.hasNext()) {
//System.out.println("value: " + valueIterator.next());

//System.out.println("Key: " + keyIterator.next() +""+"value: "+valueIterator.next());

String hashkey = valueIterator.next();

}

}

`

4

1 に答える 1