createTable() function does not work for MongoDB


#1

POST /mongodb/_schema/{table_name} does not work as expected

Steps to reproduce this error:

  1. Open Live API: http://www.dreamfactory.com/developers/live_API

  2. Open POST /mongodb/_schema/{table_name}
    Documetdation for this API method says: “createTable() - Create a table with the given properties and fields.”

  3. Set required fields:
    table_name: elephants
    schema:

    {
    “name”: “elephants”,
    “label”: “elephant”,
    “plural”: “elephants”,
    “name_field”: “name”,
    “field”: [
    {
    “name”: “name”,
    “label”: “Elephant name”,
    “type”: “string”
    }
    ]
    }

  4. Click “Try It out!”

Expected result: new collection in MongoDB, named "elephants"
Actual result: error (Table ‘elephants’ not found.)

Details:
Request URL: https://dsp-sandman1.cloud.dreamfactory.com:443/rest/mongodb/_schema/elephants
Responce Body:

{
  "error": [
    {
      "context": null,
      "message": "Table 'elephants' not found.",
      "code": 404
    }
  ]
}

I got same error in my local DreamFactory installation (permissions is not a problem here)


#2

Thanks @uniconstructor .
In order to accomplish what you are wanting, I believe you just need to use POST /mongodb/_schema

Not POST /mongodb/_schema/{table_name}