Contributions
Re: How 'find' command to be used to fetch results from mongoDB using groovy in soap ui
Hi Deepali, Query has to used as DB object when you put to find() method. Hope below query helps Try the below code try { BasicDBObject allQuery = new BasicDBObject(); allQuery.put("_id", "000000000001093467822SO01"); DBCursor cursor =dbColl.find(allQuery); //DBCursor cursor =dbColl.find(); JSON json =new JSON(); String serialize = json.serialize(cursor); System.out.println(serialize); //List list1 = new ArrayList(); while(cursor.hasNext()) { def var = cursor.next() log.info "Party id $var" } } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); }7 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.8KViews0likes0CommentsRe: How 'find' command to be used to fetch results from mongoDB using groovy in soap ui
Hi Deepali, Query has to used as DB object when you put to find() method. Hope below query helps Try the below code try { BasicDBObject allQuery = new BasicDBObject(); allQuery.put("_id", "000000000001093467822SO01"); DBCursor cursor =dbColl.find(allQuery); //DBCursor cursor =dbColl.find(); JSON json =new JSON(); String serialize = json.serialize(cursor); System.out.println(serialize); //List list1 = new ArrayList(); while(cursor.hasNext()) { def var = cursor.next() log.info "Party id $var" } } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); } Harshini Kasa7 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.8KViews0likes0Comments