diff --git a/README.md b/README.md index 2f7a563..ee6ff3e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Find some useful links below: ## Latest API Docs -Latest API Docs is 2.0.0. +Latest API Docs is 2.0.1. ## Prerequisites @@ -77,7 +77,7 @@ The MongoDB functionality are tested with the docker base integration test frame ## Features -* mongodb *(Store)*

Using this extension a MongoDB Event Table can be configured to persist events in a MongoDB of user's choice.

+* mongodb *(Store)*

Using this extension a MongoDB Event Table can be configured to persist events in a MongoDB of user's choice.

## How to Contribute diff --git a/docs/api/2.0.1.md b/docs/api/2.0.1.md new file mode 100644 index 0000000..a32d5c3 --- /dev/null +++ b/docs/api/2.0.1.md @@ -0,0 +1,259 @@ +# API Docs - v2.0.1 + +## Store + +### mongodb *(Store)* + +

Using this extension a MongoDB Event Table can be configured to persist events in a MongoDB of user's choice.

+ +Syntax +``` +@Store(type="mongodb", mongodb.uri="", collection.name="", secure.connection="", trust.store="", trust.store.password="", key.store="", key.store.password="") +@PrimaryKey("PRIMARY_KEY") +@Index("INDEX") +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
mongodb.uriThe MongoDB URI for the MongoDB data store. The uri must be of the format
mongodb://[username:password@]host1[:port1][,hostN[:portN]][/[database][?options]]
The options specified in the uri will override any connection options specified in the deployment yaml file.
STRINGNoNo
collection.nameThe name of the collection in the store this Event Table should be persisted as.Name of the siddhi event table.STRINGYesNo
secure.connectionDescribes enabling the SSL for the mongodb connectionfalseSTRINGYesNo
trust.storeFile path to the trust store.${carbon.home}/resources/security/client-truststore.jksSTRINGYesNo
trust.store.passwordPassword to access the trust storewso2carbonSTRINGYesNo
key.storeFile path to the keystore.${carbon.home}/resources/security/client-truststore.jksSTRINGYesNo
key.store.passwordPassword to access the keystorewso2carbonSTRINGYesNo
+ +System Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Parameters
applicationNameSets the logical name of the application using this MongoClient. The application name may be used by the client to identify the application to the server, for use in server logs, slow query logs, and profile collection.nullthe logical name of the application using this MongoClient. The UTF-8 encoding may not exceed 128 bytes.
cursorFinalizerEnabledSets whether cursor finalizers are enabled.truetrue
false
requiredReplicaSetNameThe name of the replica setnullthe logical name of the replica set
sslEnabledSets whether to initiate connection with TSL/SSL enabled. true: Initiate the connection with TLS/SSL. false: Initiate the connection without TLS/SSL.falsetrue
false
trustStoreFile path to the trust store.${carbon.home}/resources/security/client-truststore.jksAny valid file path.
trustStorePasswordPassword to access the trust storewso2carbonAny valid password.
keyStoreFile path to the keystore.${carbon.home}/resources/security/client-truststore.jksAny valid file path.
keyStorePasswordPassword to access the keystorewso2carbonAny valid password.
connectTimeoutThe time in milliseconds to attempt a connection before timing out.10000Any positive integer
connectionsPerHostThe maximum number of connections in the connection pool.100Any positive integer
minConnectionsPerHostThe minimum number of connections in the connection pool.0Any natural number
maxConnectionIdleTimeThe maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. A zero value indicates no limit to the idle time. A pooled connection that has exceeded its idle time will be closed and replaced when necessary by a new connection.0Any positive integer
maxWaitTimeThe maximum wait time in milliseconds that a thread may wait for a connection to become available. A value of 0 means that it will not wait. A negative value means to wait indefinitely120000Any integer
threadsAllowedToBlockForConnectionMultiplierThe maximum number of connections allowed per host for this MongoClient instance. Those connections will be kept in a pool when idle. Once the pool is exhausted, any operation requiring a connection will block waiting for an available connection.100Any natural number
maxConnectionLifeTimeThe maximum life time of a pooled connection. A zero value indicates no limit to the life time. A pooled connection that has exceeded its life time will be closed and replaced when necessary by a new connection.0Any positive integer
socketKeepAliveSets whether to keep a connection alive through firewallsfalsetrue
false
socketTimeoutThe time in milliseconds to attempt a send or receive on a socket before the attempt times out. Default 0 means never to timeout.0Any natural integer
writeConcernThe write concern to use.acknowledgedacknowledged
w1
w2
w3
unacknowledged
fsynced
journaled
replica_acknowledged
normal
safe
majority
fsync_safe
journal_safe
replicas_safe
readConcernThe level of isolation for the reads from replica sets.defaultlocal
majority
linearizable
readPreferenceSpecifies the replica set read preference for the connection.primaryprimary
secondary
secondarypreferred
primarypreferred
nearest
localThresholdThe size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances.15Any natural number
serverSelectionTimeoutSpecifies how long (in milliseconds) to block for server selection before throwing an exception. A value of 0 means that it will timeout immediately if no server is available. A negative value means to wait indefinitely.30000Any integer
heartbeatSocketTimeoutThe socket timeout for connections used for the cluster heartbeat. A value of 0 means that it will timeout immediately if no cluster member is available. A negative value means to wait indefinitely.20000Any integer
heartbeatConnectTimeoutThe connect timeout for connections used for the cluster heartbeat. A value of 0 means that it will timeout immediately if no cluster member is available. A negative value means to wait indefinitely.20000Any integer
heartbeatFrequencySpecify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one.10000Any positive integer
minHeartbeatFrequencySets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort.500Any positive integer
+ +Examples +EXAMPLE 1 +``` +@Store(type="mongodb",mongodb.uri="mongodb://admin:admin@localhost/Foo") +@PrimaryKey("symbol") +@IndexBy("volume 1 {background:true,unique:true}") +define table FooTable (symbol string, price float, volume long); +``` +

This will create a collection called FooTable for the events to be saved with symbol as Primary Key(unique index at mongod level) and index for the field volume will be created in ascending order with the index option to create the index in the background.

Note:
@PrimaryKey: This specifies a list of comma-separated values to be treated as unique fields in the table. Each record in the table must have a unique combination of values for the fields specified here.

@IndexBy: This specifies the fields that must be indexed at the database level. You can specify multiple values as a come-separated list. A single value to be in the format,
?<FieldName> <SortOrder> <IndexOptions>?
<SortOrder> - ( 1) for Ascending and (-1) for Descending
<IndexOptions> - Index Options must be defined inside curly brackets. {} to be used for default options. Options must follow the standard mongodb index options format. Reference : https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/
Example : ?symbol 1 {?unique?:true}?

+ diff --git a/docs/api/latest.md b/docs/api/latest.md index 8455394..a32d5c3 100644 --- a/docs/api/latest.md +++ b/docs/api/latest.md @@ -1,4 +1,4 @@ -# API Docs - v2.0.0 +# API Docs - v2.0.1 ## Store diff --git a/docs/index.md b/docs/index.md index 2f7a563..ee6ff3e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ Find some useful links below: ## Latest API Docs -Latest API Docs is 2.0.0. +Latest API Docs is 2.0.1. ## Prerequisites @@ -77,7 +77,7 @@ The MongoDB functionality are tested with the docker base integration test frame ## Features -* mongodb *(Store)*

Using this extension a MongoDB Event Table can be configured to persist events in a MongoDB of user's choice.

+* mongodb *(Store)*

Using this extension a MongoDB Event Table can be configured to persist events in a MongoDB of user's choice.

## How to Contribute diff --git a/mkdocs.yml b/mkdocs.yml index 6bca79e..5e1a033 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,6 +32,7 @@ markdown_extensions: pages: - Welcome: index.md - API Docs: + - 2.0.1: api/2.0.1.md - 2.0.0: api/2.0.0.md - 1.1.0: api/1.1.0.md - 1.0.21: api/1.0.21.md