less_api_client 0.0.2 copy "less_api_client: ^0.0.2" to clipboard
less_api_client: ^0.0.2 copied to clipboard

outdated

Flutter/Dart Client of less-api.

介绍 #

Flutter client sdk of less-api.

安装 #

    flutter pub get install less_api_client

使用示例 #

import 'package:less_api_client/cloud.dart' ;

final cloud = new Cloud(entryUrl: 'http://localhost:8080/entry', getAccessToken: () => getToken(),);

final db = cloud.database();


// query documents
final result = await db.collection('categories').get()

// query with options
final articles = await db.collection('articles')
    .where({})
    .orderBy({"createdAt": 'asc'})
    .offset(0)
    .limit(20)
    .get()

// count documents
final total = await db.collection('articles')
    .where({ "createdBy": 123})
    .count()

// update document
final updated = await db.collection('articles')
    .where({"id": 1})
    .update({
        "title": 'new-title'
    })

// add a document
final created = await db.collection('articles').add({
    "title": "less api database",
    "content": 'less api more life',
    "createdAt": Date.now()
})

// delete a document
final removed = await db.collection('articles')
    .where({ "id": 1 })
    .remove()
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Flutter/Dart Client of less-api.

Homepage

License

unknown (LICENSE)

Dependencies

dio

More

Packages that depend on less_api_client