{
  "synLogic": "int $ret \u003d $api($1, $2);",
  "help": "",
  "notes": "1. database\r\n\t- Provide MongoDB DataBase name.\r\n\t- For each VUser (i.e. MongoDB client) one DB name is mandatory. Suppose a client want to execute query for different collection of same DB,  client can use this API multiple time and he must be specify DB name on very first API use. If client wants to execute same query on different DB then he needs to specify DB name on every time.\r\n\t- If no DB name is provided i.e.  NULL then last selected DB will be picked automatically.\r\n\t- It can be parameterised.\r\n\t- There is no restriction on length of database name. \r\n2. collection\r\n\t- Provide Collection name of specified MongoDB.\r\n\t- Collection name is mandatory.\r\n\t- It can be parameterised.\r\n\t- There is no restriction on length of collection name.",
  "returns": "This api returns '0' on success and '-1' on failure.",
  "arguments": "\u003ctable class\u003d\"newGuiTable\"  style\u003d\"width:100%\"  \u003e 	\u003ctr\u003e 		\u003cth\u003e Argument \u003c/th\u003e     		\u003cth\u003e Description \u003c/th\u003e     	\u003c/tr\u003e 	\u003ctr\u003e    		\u003ctd\u003e dbname \u003c/td\u003e     		\u003ctd\u003e Provide name of desired database \u003c/td\u003e     	\u003c/tr\u003e  	\u003ctr\u003e       		\u003ctd\u003e collname \u003c/td\u003e     		\u003ctd\u003e Provide name of desired collection \u003c/td\u003e     	\u003c/tr\u003e     \u003c/table\u003e",
  "parameterization": "database and collection name can be parameterised",
  "name": "ns_mongodb_select_db_coll",
  "syntax": "int ns_mongodb_select_db_coll(char *dbname , char *collname)",
  "javaSyntax": "",
  "cEx": "flow()\n{\n  char* dbname = \"my_database\";\n  char* collname = \"my_collection\";\n\n  // Select the database and collection\n  int result = ns_mongodb_select_db_coll(dbname, collname);\n\n  if (result == 0) {\n    printf(\"Successfully selected database '%s' and collection '%s'\", dbname, collname);\n  } else {\n    printf(\"Failed to select database '%s' and collection '%s'\", dbname, collname);\n  }\n}",
  "javaEx": "",
  "insertStrC": "ns_mongodb_select_db_coll(char *dbname , char *collname);",
  "insertStrJava": "",
  "description": "The ns_mongodb_select_db_coll API is responsible for selecting specified MongoDB and it’s associated collection. \r",
  "component":[
	  {
      "id": "$1",
      "type": "TextField",
      "label": "Database Name",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter Database Name",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      }
    },
    {
      "id": "$2",
      "type": "TextField",
      "label": "Collection Name",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter Collection Name",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      }
    }
  ]
}
