0

i have a code in sql in a java envirnmen which is looks like TXT='121';

SELECT NAME FORM TAB WHERE ID=TXT;

TXT is define as a '121' which is VARCHAR2 datatype can i convert this query into MongoDB where i can the ID from another variable thnks in advance can i do this like

db.Collection_name.find({'NAME':1},{'ID':'.....values.....'});

can it is possible ?

prtk
  • 21
  • 3
  • Tutorial in the core documentation [Limit Fields to Return from a Query](http://docs.mongodb.org/manual/tutorial/project-fields-from-query-results/) – Blakes Seven Jul 31 '15 at 04:54
  • possible duplicate of [How to select a single field in MongoDB?](http://stackoverflow.com/questions/25589113/how-to-select-a-single-field-in-mongodb) – Blakes Seven Jul 31 '15 at 04:58

0 Answers0