Closed
Description
I got an MongoError when I use ParseLiveListWidget
LiveQuery is working on the same ParseObject.
I can query the column with result.
I don't know if I've forgotten something or if it's a bug
parse_server_sdk_flutter: ^3.1.0
parse_server: 4.5.0
StackTrace
I/flutter ( 7595): ╭-- Parse Response
I/flutter ( 7595): Class: Activity
I/flutter ( 7595): Function: ParseApiRQ.query
I/flutter ( 7595): Status Code: 1
I/flutter ( 7595): Type: No Results
I/flutter ( 7595): Error: {ok: 0, code: 40352, codeName: Location40352, name: MongoError}
I/flutter ( 7595): ╰--
I/flutter ( 7595):
StackTrace Server
error: Parse error: MongoError: FieldPath cannot be constructed with empty string {"code":1,"stack":"Error: MongoError: FieldPath cannot be constructed with empty string\n at ...\\parse-server-4.5.0\\lib\\Controllers\\DatabaseController.js:1170:21\n at runMicrotasks (<
anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)"}
Page
class HomePage extends StatelessWidget {
// static const String route = 'home';
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
QueryBuilder<ParseObject> query =
QueryBuilder<ParseObject>(ParseObject('Activity'))
..whereEqualTo('author', user.state!);
return SafeArea(
child: Scaffold(
body: Center(
child: Container(
padding: const EdgeInsets.all(16),
child: Column(
children: [
ElevatedButton(
onPressed: () async {
ParseResponse res = await query.query();
print(res);
},
child: Text('Get'),
),
SizedBox(
height: 500,
child: ParseLiveListWidget<ParseObject>(
query: query,
),
),
],
),
),
),
),
);
}
}
Init
await Parse().initialize(
'myAppId',
'http://192.168.178.53:1337/parse',
liveQueryUrl: 'ws://192.168.178.53:1337/parse',
clientKey: "lksfjiopj390ue3hfloikh",
autoSendSessionId: true,
debug: true,
// liveListRetryIntervals: [-1],
parseUserConstructor: (username, password, emailAddress,
{client, debug, sessionToken}) =>
User(username, password, emailAddress,
client: client, debug: debug, sessionToken: sessionToken),
);
Server
{
"appId": "myAppId",
"masterKey": "sfjIFJopnfwoifnpsifhjpwep09324ui9nflknlKNLNl",
"clientKey": "lksfjiopj390ue3hfloikh",
"javascriptKey": "lksfjlksjfeopihj",
"mountGraphQL": true,
"mountPlayground": true,
"databaseURI": "mongodb://192.168.178.96",
"cloud": "./cloud/main.js",
"allowClientClassCreation": false,
"liveQuery": {
"classNames": ["_User", "Activity"]
},
"startLiveQueryServer": true,
"auth": {
"firebase": {
"module": "parse-firebase-adapter"
},
"google": {}
}
}