@axway/api-builder-plugin-dc-mongo
MongoDB data connector for Axway API Builder
Last updated 2 months ago by bladedancer .
SEE LICENSE IN LICENSE · Repository · Original npm · Tarball · package.json
$ cnpm install @axway/api-builder-plugin-dc-mongo 
SYNC missed versions from official npm registry.

MongoDB Connector

The MongoDB data connector is a plugin for API Builder that can connect to your MongoDB instance and interrogate your schema that will automatically provision Models into to your application, and optionally, automatically generate a rich CRUD API to the underlying tables. The Models can be used programmatically, or can be used within the flow editor to interact with your database.

Minimum requirements

Supported versions

  • MongoDB 3.6

Memory

  • ~10 MB

Disk space

  • ~14 MB

Supported features

  • Automatic generation of Models from MongoDB collections
  • Automatic generation of API for Models
  • Full CRUD operations on tables via Models

Installation

npm install --no-optional @axway/api-builder-plugin-dc-mongo

A configuration file is generated for you and placed into the conf directory of your API Builder project. By default, we use a host of localhost, and a table called apibuilder.

Configuration

Once the plugin is installed, the configuration file is located <project>/conf/mongo.default.conf.

Option name Type Description
connector string Must be: @axway/api-builder-plugin-dc-mongo
url string The MongoDB database URL.
generateModelsFromSchema boolean If enabled, API Builder will automatically interrogate the database and auto-generate Models from MongoDB collections.
modelAutogen boolean If enabled, API Builder will automatically generate a full and rich CRUD API from the generated Models.

Usage

After you configure the connector, you can start up your API Builder project and visit the console (normally found under http://localhost:8080/console). Your connector will be listed under the Connectors section of the console.

Your MongoDB collections will be listed under the Models section of the console. You can now click on the gear icon to the right of the table names and generate flow based APIs.

You can also reference the connector in a custom model.

var User = APIBuilder.Model.extend('user', {
	fields: {
		name: { type: String, required: false, validator: /[a-zA-Z]{3,}/ }
	},
	connector: 'mongo'
});

If you want to map a specific model to a specific collection name, use metadata. For example, to map the user model to the collection users, set it such as:

var User = APIBuilder.Model.extend('user', {
	fields: {
		name: { type: String, required: false, validator: /[a-zA-Z]{3,}/ }
	},
	connector: 'mongo',
	metadata: {
		'mongo': {
			collection: 'users'
		}
	}
});

Known issues and limitations

None

Changes

1.1.12

  • #6116: Internal cleanup chore.

1.1.11

  • #6115: Internal fix for Sonar scans.

1.1.10

  • #6074: Internal CI chore

1.1.9

  • #5711: Internal cleanup of npm scripts.

1.1.8

  • #5715: Internal changes to remove integration tests.

1.1.7

  • #5709: Internal changes to update eslint rules.

1.1.6

  • #5707: Internal cleanup to code coverage during build process.

1.1.2

  • #5050: Updating license text.

1.1.0

  • #4532: Data connectors table methods did not display the proper type for the PK Previously, APIs and flows generated for models based created by data connectors assumed a IDs were of type string. Now,the APIs and flows will use the proper type for the primary key.

1.0.3

  • #4757: Changed SCM repository and associated internal cleanup.

License

This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: https://support.axway.com/en/auth/general-conditions; EXCEPT THAT IF YOU RECEIVED A FREE SUBSCRIPTION, LICENSE, OR SUPPORT SUBSCRIPTION FOR THIS CODE, NOTWITHSTANDING THE LANGUAGE OF THE GENERAL CONDITIONS, AXWAY HEREBY DISCLAIMS ALL SUPPORT AND MAINTENANCE OBLIGATIONS, AS WELL AS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED INFRINGEMENT WARRANTIES, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND YOU ACCEPT THE PRODUCT AS-IS AND WITH ALL FAULTS, SOLELY AT YOUR OWN RISK. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.

Current Tags

  • 1.1.13                                ...           latest (2 months ago)
  • 1.1.13                                ...           next (2 months ago)
  • 1.0.0-10                                ...           v4-preview3 (2 years ago)

28 Versions

  • 1.1.13                                ...           2 months ago
  • 1.1.12                                ...           6 months ago
  • 1.1.11                                ...           6 months ago
  • 1.1.10                                ...           8 months ago
  • 1.1.9                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.7                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 1.0.0-10                                ...           2 years ago
  • 1.0.0-9                                ...           2 years ago
  • 1.0.0-8                                ...           2 years ago
  • 1.0.0-7                                ...           2 years ago
  • 1.0.0-6                                ...           2 years ago
  • 1.0.0-5                                ...           2 years ago
  • 1.0.0-4                                ...           2 years ago
  • 1.0.0-3                                ...           2 years ago
  • 1.0.0-2                                ...           2 years ago
  • 1.0.0-1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 28
Last Month 58
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |