style_mongo

Creator: coderz1093

Last updated:

0 purchases

style_mongo Image
style_mongo Images

Languages

Categories

Add to Cart

Description:

style mongo

style_mongo #
Style mongo is a DataAccess implementation for style_dart.
Usage #
Put To Component Tree #
@override
Component build(BuildContext context) {
return Server(
dataAccess: DataAccess(
MongoDbDataAccessImplementation("<connection-string>")
),
children: [
//...
]);
}
copied to clipboard
OR

@override
Component build(BuildContext context) {
return ServiceWrapper<DataAccess>(
service: DataAccess(
MongoDbDataAccessImplementation("<connection-string>")
),
child: YourChildComponent(),
);
}


copied to clipboard
Operate #
FutureOr<Object> onCall(Request request) {
return Access(
collection: "<collection>",
type: type,

// optional. necessary for some operations
// you can also use "Query"
query: MongoQuery(where.eq("field", "value")),

// optional. necessary for aggregation
pipeline: AggregationPipelineBuilder(/*stages*/),
// or pipeline: [{"\$project" : {"_id":0}}]
);
}
copied to clipboard
You can operate with any different styles like DataAccess.of(ctx).read(..) .
Using with Query, selector parameter must be mongo db style Map.
So must be where.eq("field", "value").map["\$query"].
Settings #
MongoDb have many operation settings like WriteConcern.
You can set this settings with:
f(){
final access = Access(
settings: MongoDbFindSettings(findOptions: FindOptions(returnKey: true))
//...
);
}
copied to clipboard
There is settings for all operations, except count and exists
Example Usage with AccessPoint #
Check Example

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.