marioreggiori / objectdb Goto Github PK
View Code? Open in Web Editor NEWPersistent embedded document-oriented NoSQL database for Dart and Flutter.
Home Page: https://pub.dev/packages/objectdb
License: MIT License
Persistent embedded document-oriented NoSQL database for Dart and Flutter.
Home Page: https://pub.dev/packages/objectdb
License: MIT License
I need to manage different kind of documents (event, user, book).
How to manage different query based on document type ?
Do I need to add an "extra field" in all document type to specify the type of document ?
Hi,
I have a data structure: Book->Authors[id,name]
book contains a list of authors, each entry has an ID and name. How do I query book to get the authors id?
I've tried the following:
authors.id: which get's the record into the match method but doesn't select it
authors[].id: doesn't get the record at all (found this as an example for this library on Goog)
Are lists supported?
Thanks.
glenn
Hi,
The db behaves wrong when a update-record contains null values. Inserting and updating documents with null-values works because because the default function json.encode
is used.
This leads to the problem, when calling open()
it always returns the inital version (and not the latest (upated) one).
This because on open()
the database goes through all lines in the db-file and the insert-lines ('+') are decoded by json.decode
but the update-lines ('~') are decoded by the custom function _decode
and this custom decode-function does not accept null values. In this case an ObjectDBException
is thrown and this leads to the line being ignored.
In my opinion two things should be done:
_decode
db.find()
always returned an old version.Regards,
Florian
save()async{
final path = Directory.current.path + '/my.db';
Directory appDocDir = await getApplicationDocumentsDirectory();
final db = ObjectDB(appDocDir.path);
db.open();
// insert document into database
db.insert({'name': 'qq'});
result = await db.find({'name.first': 'qq'});
await db.close();
}
ERROR__
Restarted application in 8 168ms.
F/libc (12929): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x80000024 in tid 12957 (1.ui), pid 12929 (ple.flutter_app)
Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:11/RSR1.201013.001/6903271:userdebug/dev-keys'
Revision: '0'
ABI: 'x86'
Timestamp: 2021-02-11 09:02:58+0000
pid: 12929, tid: 12957, name: 1.ui >>> com.example.flutter_app <<<
uid: 10154
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x80000024
eax 80000000 ebx c12d9420 ecx 00000002 edx 000009ea
edi be710090 esi 00000003
ebp c17bc278 esp c17bc210 eip c11c612f
backtrace:
#00 pc 019c612f /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#1 pc 019c7bb2 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#2 pc 019c70df /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#3 pc 019c6c77 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#4 pc 019c6199 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#5 pc 019c7bb2 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#6 pc 019c502a /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#7 pc 019c3e14 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#8 pc 017f9c7c /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#9 pc 0199395d /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#10 pc 01993718 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#11 pc 019a3d51 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#12 pc 018828d8 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#13 pc 01883ba2 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#14 pc 01884b44 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#15 pc 018845ef /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#16 pc 017aaf5a /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#17 pc 01882d01 /data/app/~~mtsuQtmD3-MDmKBRqz_Lxg==/com.example.flutter_app-k2n3TG_WgSutg7NtO4uF2w==/lib/x86/libflutter.so (BuildId: aaf57673e431d778c3574f8310d08eae434fb178)
#18 pc 000012ab anonymous:be980000
Lost connection to device.
Can i find list data by paging only use query?
Is there a method to clean up repeated documents?
First of all thanks a lot for the database!
I would have one request for the documentation though: Would it be possible to add an example of how to query data from the database and add the results to a Listview
widget?
It is a relatively common pattern and adding it to the documentation would probably shorten up the adaptation time for objectdb.
Its nice to see a purely dart database.
I was wondering what you had in mind for the indexing. I ask because i saw a Dart database that implemented full faceted search like Elastic search.
Here it is:
https://bitbucket.org/ouava/ducene/overview
And the example, whichis a bit buggy when loading. Takes a while to get going:
https://ouava.github.io/#/pubsearch
Also check out this to see what faceted search is, in case your not sure:
https://github.com/rubnvp/mongo-facets
Love to hear your opinions on this.
{"2021-05-23 06:22:10.149196":{"symbol":"mvis","action":"bought","quantity":0.0,"cost":20.5,"watch":true},"_id":"60aa3ae2e723bbff6862ae69"} {"2021-05-23 06:22:10.154262":{"symbol":"gbtc","action":"bought","quantity":0.0,"cost":52.96,"watch":true},"_id":"60aa3ae2e723bbff6862ae6a"} {"2021-05-23 06:22:10.155244":{"symbol":"gme","action":"bought","quantity":0.0,"cost":79.88,"watch":true},"_id":"60aa3ae2e723bbff6862ae6b"} {"2021-05-23 06:22:10.155363":{"symbol":"amc","action":"bought","quantity":0.0,"cost":16.5,"watch":true},"_id":"60aa3ae2e723bbff6862ae6c"} {"2021-05-23 06:22:10.155430":{"symbol":"msft","action":"bought","quantity":0.0,"cost":250.0,"watch":true},"_id":"60aa3ae2e723bbff6862ae6d"}
find() returns all documents as expected.
find({'watch': true}) returns an empty list.
first({'watch': true}) returns no documents.
last({'watch': true}) returns no docments.
first and last with query result in a Bad State exception in dart Stream somewhere.
Is is the structure of my documents causing this issue?
I need to store and query documents with DateTime (dart type) support.
Is it supported ?
When I try to add a document with DateTime property an exception is fired.
As I implemented ObjectDB I noticed two minor issues.
First, it seems to me that db.delete({'active': false});
in the examples has become obsolete, and has been replaced by db.remove({'active': false});
.
Secondly I found it difficult to add subdocuments to an already existing doument, since the way to do it right now seems to be to db.find()
the current subdocument, and then db.update()
the parent document with currentSubdocument.addAll(changes)
. In this case however .addAll()
returns an error saying The expression here has a type of 'void', and therefore cannot be used
.
Adding addToDocument()
would probably greatly simplify the process, or am I missing something here?
Describe the bug
When doing an update
the system responds with ArgumentError
in _encodeValue()
in objectdb_storage_filesystem.dart
. Since the structure is big I do not have any hint which type cannot be encoded here. Therefore I ask to give more information in the exception. For example the type of the value.
To Reproduce
Expected behavior
An exception stating what type cannot be encoded.
Screenshots
Desktop (please complete the following information):
// @dart=2.9
in the first line of main.dartI am currently trying to insert a different document into objectDb depending on the users locale.
In short, my code currently goes like:
void main() async {
// get document directory using path_provider plugin
Directory appDocDir = await getApplicationDocumentsDirectory();
String dbFilePath = [appDocDir.path, 'user.db'].join('/');
// initialize and open database
db = ObjectDB(dbFilePath);
// delete old database file if exists
File dbFile = File(dbFilePath);
// check if database already exists
var isNew = !await dbFile.exists();
db.open();
if (isNew) {
//insert first document
final document =
r'[{"insert":"Welcome"}];
db.insert({
'document': document,
'key': randomKey,
});
}
}
Now I am wondering: Is it possible to insert a different document into the db depending on the user devices locale? My first try was using Localizations.localeOf(context);
which however didn't work because the main()
function does not have a context. Is there any other way of achieving this?
PS: Sorry for asking a simple question as an issue, I just didn't find any other place to ask. Thanks a lot for the awesome database! 👍
Please allow inserting a data that already contains the _id field:
Change:
ObjectId _insert(data) {
ObjectId _id;
_id = ObjectId();
data['_id'] = _id.toString();
...
}
To:
ObjectId _insert(data) {
ObjectId _id;
if (data.containsKey('_id')) {
_id = ObjectId.fromHexString(data['_id']);
} else {
_id = ObjectId();
data['_id'] = _id.toString();
}
...
}
I have a problem when finding objects by _id for example with this object i can find it with any key. hero, name item but not with _id sorry for my bad english :
"_id":"5a819757d3a28c13faa1fa39","hero":"Lesley","name":"top rank 5","item1":"Swift boots","item2":"Berserker's fury","item3":"Endless battle","item4":"Windtalker","item5":"Haass's claws","item6":"Immortality","__v":0}
inserting a null value is Ok,
but updating by a null value throws error.!!
on Web is OK but on Android occur this.
Is there any way to get the data without a query? eg: db.get('name') to finad a particular one or db.get() to get all the data
This is the json that I am trying to add. This is a valid json can anyone tell me why it's not able to insert it?
{
"id": "48866",
"title": "The 100",
"overview": "100 years in the future, when the Earth has been abandoned due to radioactivity, the last surviving humans live on an ark orbiting the planet — but the ark won't last forever. So the repressive regime picks 100 expendable juvenile delinquents to send down to Earth to see if the planet is still habitable.",
"posterurl": "https://image.tmdb.org/t/p/w300//wBzNjurA8ijJPF21Ggs9nbviIzi.jpg",
"posterpath": "/posters/48866.jpg",
"backdropurl": "https://image.tmdb.org/t/p/w780//qYTIuJJ7fIehicAt3bl0vW70Sq6.jpg",
"backdroppath": "/backdrops/48866.jpg",
"latest_episode_air_date": "2019-05-07",
"latest_episode_to_air": {
"episode_number": 2,
"id": 1686688
},
"season_length": 6,
"episodes_length": "",
"status": "Returning Series",
"type": "",
"episode_runtime": 43,
"last_watched": "",
"seasons": {
"1": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13
],
"2": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16
],
"3": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16
]
}
}
first function breaks with following message if there is no data in database:
E/flutter ( 5223): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter ( 5223): Bad state: No element
E/flutter ( 5223): #0 _ListBase&Object&ListMixin.firstWhere (dart:collection/list.dart:148:5)
E/flutter ( 5223): #1 ObjectDB._find. (package:objectdb/src/objectdb_base.dart:369:27)
E/flutter ( 5223): #2 new Future.sync (dart:async/future.dart:224:31)
E/flutter ( 5223): #3 ObjectDB._find (package:objectdb/src/objectdb_base.dart:363:19)
E/flutter ( 5223):
E/flutter ( 5223): #4 ObjectDB.first. (package:objectdb/src/objectdb_base.dart:480:50)
E/flutter ( 5223): #5 ExecutionQueue._check (package:execution_queue/execution_queue.dart:19:42)
E/flutter ( 5223):
E/flutter ( 5223): #6 ExecutionQueue._check (package:execution_queue/execution_queue.dart:21:12)
E/flutter ( 5223):
E/flutter ( 5223): #7 ExecutionQueue.add (package:execution_queue/execution_queue.dart:28:10)
E/flutter ( 5223): #8 ObjectDB.open (package:objectdb/src/objectdb_base.dart:35:33)
Cant seem to add data to my DB. I get the error
`FileSystemException: Cannot delete file, path = '/data/user/0/com.thePlay/app_flutter/expenses.data.bak' (OS Error: No such file or directory, errno = 2)
File._delete. (dart:io/file_impl.dart:295:9)
RootZone.runUnary (dart:async/zone.dart:1379:54)
FutureListener.handleValue (dart:async/future_impl.dart:129:18)
Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
Future._propagateToListeners (dart:async/future_impl.dart:671:32)
Future._completeWithValue (dart:async/future_impl.dart:486:5)
Future._asyncComplete. (dart:async/future_impl.dart:516:7)
_microtaskLoop (dart:async/schedule_microtask.dart:41:21) _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)`
do you load into memory or read from file directly
import 'package:objectdb/src/objectdb_storage_filesystem.dart';
And I suspect the other storage imports gives a warning for importing implimentation files from another package.
Perhaps they should be exported from objectdb,dart?
Hi,
According to rfc7159 (https://tools.ietf.org/html/rfc7159) a JSON can also have an array as top level element
[
{...},
{...},
{...}
]
Because the methods of the objectdb are of type Map<String, dynamic>
(for insert and update) it is not possible to pass a List to be stored. Would be great if this will be possible in a future version.
Regards,
Florian
When I update or insert sometimes I am getting "data contains invalid data types":
ObjectId _insert(data) {
ObjectId _id = ObjectId();
data['_id'] = _id.toString();
try {
this._writer.writeln('+' + json.encode(data));
this._insertData(data);
} catch (e) {
throw ObjectDBException('data contains invalid data types');
}
return _id;
}
e.message is "StreamSink is closed"
If I insert a new document in my database which already has other documents will it insert it on top of the other documents or at the bottom?
if at the bottom, is there a way I can other my documents in desc when I fetch docs from db?
I currently have an app in production (~10.000 users) that uses object_db as its main database. The problem I am facing currently however is that when I started working on this app I chose a very bad database structure that has been causing a number of problems ever since.
This is why I am now trying to restructure the production data with the next update, however I need to ensure that this happens smoothly without any data loss for customers. So here is my question: At which location in the code is this done best (I was thinking in the main function right after the db is initialised) and how do I ensure that the restructure happens only once?
It is my understanding that this is best done by querying the entire dataset first, then writing the data in the restructured format and in the end deleting the old data. Is this the recommended approach or would you suggest a different method?
PS: Thank you very much for this awesome database!
Hi,
I'm trying to remove a record. The query for the remove is the 'identity' attribute with the value: 7b612a09-8898-46cf-ae0c-8385e4899629
I'm getting this exception from the remove method:
exception = {FormatException} FormatException: Unexpected character (at character 58)\n{"identity":"698b88d8-2857-4652-9b80-31fe2fa9cae0","em-{"identity":"7b61
message = "Unexpected character"
source = "{"identity":"698b88d8-2857-4652-9b80-31fe2fa9cae0","em-{"identity":"7b612a09-8898-46cf-ae0c-8385e4899629"}"
offset = 57
This is what the database looks like before and after the remove(file):
BEFORE
$objectdb{"version":1,"client_version":1}
{"identity":"698b88d8-2857-4652-9b80-31fe2fa9cae0","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff0536b3183d9f3467ccb2"}
{"identity":"386993bf-d31d-4546-a07b-7b62f891e137","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff059840e29701d2942841"}
{"identity":"4482e911-6a7d-4923-b4c9-1c791db737d6","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff05fed671d2556759396a"}
{"identity":"7b612a09-8898-46cf-ae0c-8385e4899629","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff0ffa1e6ba7185717df4e"}
{"identity":"6f0fcb3d-cc67-4d61-8332-71b9cc4d3686","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff12393f8e62477a7bec59"}
AFTER
$objectdb{"version":1,"client_version":1}
{"identity":"698b88d8-2857-4652-9b80-31fe2fa9cae0","em-{"identity":"7b612a09-8898-46cf-ae0c-8385e4899629"}
by","last":"Flay"},"_id":"60ff0536b3183d9f3467ccb2"}
{"identity":"386993bf-d31d-4546-a07b-7b62f891e137","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff059840e29701d2942841"}
{"identity":"4482e911-6a7d-4923-b4c9-1c791db737d6","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff05fed671d2556759396a"}
{"identity":"7b612a09-8898-46cf-ae0c-8385e4899629","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff0ffa1e6ba7185717df4e"}
{"identity":"6f0fcb3d-cc67-4d61-8332-71b9cc4d3686","email":"[email protected]","notes":null,"name":{"first":"Bobby","last":"Flay"},"_id":"60ff12393f8e62477a7bec59"}
You can see that the record with the identity '7b612a09-8898-46cf-ae0c-8385e4899629' has been removed, but a new record has been inserted into the file and this is what seems to be causing the exception listed above.
I've seen something simular to this with the 'update' method, it left an artifact in the DB that a call to 'cleanup' fixed. This error is coming directly out of the ObjectDB remove method. I think this exception is masking something else, but I can't see what.
What's happening here? Can you provide the flow of what to expect?
What's the cause of the 'added record' not being removed?
Hi,
I am trying to download a file with dio and then adding the file's data to the database. Sometimes, it gets added to the database and other times it doesn't. Can you please tell me if it's something that I'm doing wrong or is it a fault from the library.
await dio.download(attachment.url, path,
onReceiveProgress: (receive, total) {
progress = ((receive / total));
progressDataCallBack(progress);
}, cancelToken: cancelToken).whenComplete(
() async => await LibraryDownloadsDB().add(
{
'id': attachment.id.toString(),
'name': attachment.name,
'path': path,
'fileType': attachment.fileType
},
),
);
This is my downloading function with call to add data to database.
add(Map item) async {
final db = ObjectDB(await getPath());
db.open();
await db.insert(item);
db.tidy();
await db.close();
}
This is the add method to insert the data into database.
Qualquer chance de suporte a objectdb para flutter desktop-incorporação,
https://github.com/google/flutter-desktop-embedding
Title says it all. I am trying to get a count of the number of items in the DB using db.find(). find() never returns when executed in the isolate. Can you think of a reason this would not work?
db.hashCode works as expected in the isolate.
By isolate I mean a secondary isolate outside the main isolate.
Thanks,
Jonny
Considering 100% approach to REST API I'm looking for possible ways to make 100% Dart serverside REST API+DB Aqueduct+Objectdb would be a good combo for Dart enthusiasts!
the first thing I tried to run this code on my Flutter app
final path = Directory.current.path + '/my.db';
i got this exception
FileSystemException: Cannot create file, path = '//my.db' (OS Error: Read-only file system, errno = 30)
is there any permission needs to be added before trying to create the database?
This isn't really an issue, just me having a problem and no better place to ask the question :)
I am currently implementing objectdb and created this test document:
{
'cards': {'key01': {'question': 'buscar', 'answer': 'search'},'key02': {'question': 'tener', 'answer': 'have'} },
'name': 'Spanish Vocabs',
},
As you can see I tried to create a document with a subdocument named cards
, that again has subdocuments that will have a randomly generated key ('key01' etc. in this example) as an identifier.
Now I would like to put all the subdocuments of cards
into a List [ ]
that I could pass on to another screen of the app. Is this possible with objectdb and if so, could you give me a hint on how to implement it?
Trying to delete the database but i get an error i believe is from ObjectDB's end.
This is my code for deletion.
Future deleteCapturedData(String projectId) async {
Directory appDocDir = await getApplicationDocumentsDirectory();
String dbFilePath = appDocDir.path + "/op_" + projectId + ".data";
var db = ObjectDB(dbFilePath);
db.open();
await db.remove({});
await db.close();
}
Sometimes when the app starts I'm getting this weird error and a small crash (around 3 seconds)
Error -32000 received from application: Server error
JSON-RPC error -32000: Server error
Any idea what could be ?
Hi, i would like to know if it a secure db ?
Is there a tool to create and export a database so that it can be used in an application?
I have a SQL Lite database with more than 200k entries.
What is the storage capacity?
Is your feature request related to a problem? Please describe.
I need possibility to filter data by text serch
Describe the solution you'd like
Text search methods like startsWith, endsWith, contains, etc
Describe alternatives you've considered
One can use collections alternatives, but native mechanism would be better.
please i wanted to ask when the ObjectDb will be available for full production, on your site. i saw a caution to use at owners risk, and wanted to know when it will be fully available.
The whole existing codebase needs a rework of its documentation
Hi I Have two different documents in the db:
{
"userData" : {
"id":"16",
"phone_number":"+233247832697",
"first_name":"Michael",
"last_name":"Sowah",
"username":"mtsowah"
},
token: "9a647851935d03bbc87e25cef1bba0089efabcb1"
}
{
{
"id":"1",
"title":"Amazing! collection",
"entity":"Amazing! collection","location":"Accra, Ghana",
"description":"Amazingingly beautifull and quite affordable quality jeans..",
"category":"Fashion",
"type_id":"1",
"reaction":"praise",
"user_id":"2",
"fullname":"James Bond",
"username":"jamesbond007"
},
{
"id":"2",
"title":"collection",
"entity":"Amazing! collection","location":"Accra, Ghana",
"description":"Amazingingly beautifull and quite affordable quality jeans..",
"category":"Fashion",
"type_id":"1",
"reaction":"praise",
"user_id":"2",
"fullname":"James Bond",
"username":"jamesbond007"
}
}
Simple line of
db = ObjectDB(dbFilePath);
Causes:
* thread #9, name = 'io.flutter.1.ui', stop reason = EXC_BAD_ACCESS (code=1, address=0x6f746172617065af)
frame #0: 0x000000010548fe50 Flutter`dart::kernel::ScopeBuilder::VisitFunctionNode() + 656
Flutter`dart::kernel::ScopeBuilder::VisitFunctionNode:
-> 0x10548fe50 <+656>: strb w9, [x10, #0x3c]
0x10548fe54 <+660>: add x8, x8, #0x1 ; =0x1
0x10548fe58 <+664>: ldr x10, [x21, #0x8]
0x10548fe5c <+668>: ldur w10, [x10, #0x7b]
Target 0: (Runner) stopped.
Lost connection to device.
iOS 14.2, Xcode 12, Big Sur
Failing on Beta & Master channels
How to delete all documents in the db ?
Solution 1: find the correct query
Solution2: close the db, delete the file and recreate db
What is the recommandation ?
There is a way to find with a part of a string
ex: find School with Sch only
I find first element with property not null but it not working. Please help me to query it.
a.first( { Op.not: {'units': null} });
How to create different tables
When I update a record in db and then i see in log, record are updated with new data. But when i reopen App, data in record no change after update method. Anyone have idea for fix that ?
When inserting document, an objectId is returned.
Is it possible to find document based on the returned objectId using the toString() method of the ObjectId ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.