Driver Nosql
Driver Nosql protocol schemas
NoSQL Database Type Enumeration
Supported NoSQL database types
Source: packages/spec/src/data/driver-nosql.zod.ts
import { AggregationPipeline, AggregationStage, ConsistencyLevel, DocumentValidationSchema, NoSQLDataTypeMapping, NoSQLDatabaseType, NoSQLDriverConfig, NoSQLIndex, NoSQLIndexType, NoSQLOperationType, NoSQLQueryOptions, NoSQLTransactionOptions, ReplicationConfig, ShardingConfig } from '@objectstack/spec/data';
import type { AggregationPipeline, AggregationStage, ConsistencyLevel, DocumentValidation, NoSQLDataTypeMapping, NoSQLDatabaseType, NoSQLDriverConfig, NoSQLIndex, NoSQLIndexType, NoSQLOperationType, NoSQLQueryOptions, NoSQLTransactionOptions, ReplicationConfig, ShardingConfig } from '@objectstack/spec/data';
// Validate data
const result = AggregationPipeline.parse(data);
| Property | Type | Required | Description |
|---|
| collection | string | ✅ | Collection/table name |
| stages | Object[] | ✅ | Aggregation pipeline stages |
| options | Object | optional | Query options |
| Property | Type | Required | Description |
|---|
| operator | string | ✅ | Aggregation operator (e.g., $match, $group, $sort) |
| options | Record<string, any> | ✅ | Stage-specific options |
all
quorum
one
local_quorum
each_quorum
eventual
| Property | Type | Required | Description |
|---|
| enabled | boolean | ✅ | Enable schema validation |
| validationLevel | Enum<'strict' | 'moderate' | 'off'> | optional | Validation strictness |
| validationAction | Enum<'error' | 'warn'> | optional | Action on validation failure |
| jsonSchema | Record<string, any> | optional | JSON Schema for validation |
| Property | Type | Required | Description |
|---|
| text | string | ✅ | NoSQL type for text fields |
| number | string | ✅ | NoSQL type for number fields |
| boolean | string | ✅ | NoSQL type for boolean fields |
| date | string | ✅ | NoSQL type for date fields |
| datetime | string | ✅ | NoSQL type for datetime fields |
| json | string | optional | NoSQL type for JSON/object fields |
| uuid | string | optional | NoSQL type for UUID fields |
| binary | string | optional | NoSQL type for binary fields |
| array | string | optional | NoSQL type for array fields |
| objectId | string | optional | NoSQL type for ObjectID fields (MongoDB) |
| geopoint | string | optional | NoSQL type for geospatial point fields |
mongodb
couchdb
dynamodb
cassandra
redis
elasticsearch
neo4j
orientdb
| Property | Type | Required | Description |
|---|
| name | string | ✅ | Driver instance name |
| type | string | ✅ | Driver type must be "nosql" |
| capabilities | Object | ✅ | Driver capability flags |
| connectionString | string | optional | Database connection string (driver-specific format) |
| poolConfig | Object | optional | Connection pool configuration |
| databaseType | Enum<'mongodb' | 'couchdb' | 'dynamodb' | 'cassandra' | 'redis' | 'elasticsearch' | 'neo4j' | 'orientdb'> | ✅ | Specific NoSQL database type |
| dataTypeMapping | Object | ✅ | NoSQL data type mapping configuration |
| consistency | Enum<'all' | 'quorum' | 'one' | 'local_quorum' | 'each_quorum' | 'eventual'> | optional | Consistency level for operations |
| replication | Object | optional | Replication configuration |
| sharding | Object | optional | Sharding configuration |
| schemaValidation | Object | optional | Document schema validation |
| region | string | optional | AWS region (for managed NoSQL services) |
| accessKeyId | string | optional | AWS access key ID |
| secretAccessKey | string | optional | AWS secret access key |
| ttlField | string | optional | Field name for TTL (auto-deletion) |
| maxDocumentSize | integer | optional | Maximum document size in bytes |
| collectionPrefix | string | optional | Prefix for collection/table names |
| Property | Type | Required | Description |
|---|
| name | string | ✅ | Index name |
| type | Enum<'single' | 'compound' | 'unique' | 'text' | 'geospatial' | 'hashed' | 'ttl' | 'sparse'> | ✅ | Index type |
| fields | Object[] | ✅ | Fields to index |
| unique | boolean | ✅ | Enforce uniqueness |
| sparse | boolean | ✅ | Sparse index |
| expireAfterSeconds | integer | optional | TTL in seconds |
| partialFilterExpression | Record<string, any> | optional | Partial index filter |
| background | boolean | ✅ | Create index in background |
single
compound
unique
text
geospatial
hashed
ttl
sparse
find
findOne
insert
update
delete
aggregate
mapReduce
count
distinct
createIndex
dropIndex
| Property | Type | Required | Description |
|---|
| consistency | Enum<'all' | 'quorum' | 'one' | 'local_quorum' | 'each_quorum' | 'eventual'> | optional | Consistency level override |
| readFromSecondary | boolean | optional | Allow reading from secondary replicas |
| projection | Record<string, number | number> | optional | Field projection |
| timeout | integer | optional | Query timeout (ms) |
| useCursor | boolean | optional | Use cursor instead of loading all results |
| batchSize | integer | optional | Cursor batch size |
| profile | boolean | optional | Enable query profiling |
| hint | string | optional | Index hint for query optimization |
| Property | Type | Required | Description |
|---|
| readConcern | Enum<'local' | 'majority' | 'linearizable' | 'snapshot'> | optional | Read concern level |
| writeConcern | Enum<'majority' | 'acknowledged' | 'unacknowledged'> | optional | Write concern level |
| readPreference | Enum<'primary' | 'primaryPreferred' | 'secondary' | 'secondaryPreferred' | 'nearest'> | optional | Read preference |
| maxCommitTimeMS | integer | optional | Transaction commit timeout (ms) |
| Property | Type | Required | Description |
|---|
| enabled | boolean | ✅ | Enable replication |
| replicaSetName | string | optional | Replica set name |
| replicas | integer | optional | Number of replicas |
| readPreference | Enum<'primary' | 'primaryPreferred' | 'secondary' | 'secondaryPreferred' | 'nearest'> | optional | Read preference for replica set |
| writeConcern | Enum<'majority' | 'acknowledged' | 'unacknowledged'> | optional | Write concern level |
| Property | Type | Required | Description |
|---|
| enabled | boolean | ✅ | Enable sharding |
| shardKey | string | optional | Field to use as shard key |
| shardingStrategy | Enum<'hash' | 'range' | 'zone'> | optional | Sharding strategy |
| numShards | integer | optional | Number of shards |