Can't see the mistake while inserting in mongoDB via shell 3.6? [closed] - mongodb

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
Good evening community,
I got an problem while inserting a document in my mongoDB.
I am using the mongoshell 3.6.x
I try following:
db.collection.insert({
_id: 0000,
spot:"Gufi-See,
contact:{
street: "Haldenweg 10",
zipcode:"89423",
city:"Gundelfingen a.d. Donau",
homepage:"www.wasserski-gundelfingen.de",
phone:"09073/920690"
},
location:[
longitude:10.328760,
latitude:48.520839
]
})
Following error is thrown:
E QUERY [thread1] SyntaxError: missing } after property list #(shell):1:47
My problem is that i can't find the problem of the missing } ... Maybe One can help me out?! Thanks a lot.

Spot's name should have closed quotes like this: spot:"Gufi-See" and you can't store location in such way. You should change it to an object. Try:
db.collection.insert({
_id: 0000,
spot:"Gufi-See",
contact:{
street: "Haldenweg 10",
zipcode:"89423",
city:"Gundelfingen a.d. Donau",
homepage:"www.wasserski-gundelfingen.de",
phone:"09073/920690"
},
location:{
longitude: 10.328760,
latitude:48.520839
}
})

Related

Getting UUID as string in Mongo [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed yesterday.
Improve this question
I want to convert bin UID to String in Mongo DB, I am executing the below command on mongo console but I am getting the exception for the same, so please advise
db.test.findOne(){ "_id" : BinData(2,"AAATEREETEGAAAAGJIGAAA=="), "x" : 1 }
[2021-12-19 14:20:19] SyntaxError: Missing semicolon. (1:17)
[2021-12-19 14:20:19] > 1 | db.test.findOne(){ "_id" : BinData(3,"AAATEREETEGAAAAGJIGAAA=="), "x" : 1 }
[2021-12-19 14:20:19] | ^
[2021-12-19 14:20:19] at Parser._raise (all-standalone.js:734:17451)
and if I change the query to this below then I am getting null and not the value
db.test.findOne({ "_id" : BinData(3,"AAATEREETEGAAAAGJIGAAA=="), "x" : 1 })

Why does 'mkt_carrier_fl_num AS flight' return a syntax error 42601? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I'm new to Postgres and everything databases. I'm learning through a Pluralsight course and have finally managed to import a database. Following along with what the teacher is typing out, I query:
SELECT fl_date,
mkt_carrier AS airline
mkt_carrier_fl_num AS flight
origin,
dest
FROM performance
WHERE origin = 'ORD'
.. from a database that came with the course files, and get back this:
ERROR: syntax error at or near "mkt_carrier_fl_num"
LINE 3: mkt_carrier_fl_num AS flight
^
SQL state: 42601
Character: 45
I've googled the error code but apparently this can entail many different things. I have no idea where to go from here. Literally every function in this program is a mystery to me.
Please help.
SELECT fl_date
,mkt_carrier AS airline -- comma before the start of the column name
,mkt_carrier_fl_num AS flight
,origin
,dest
FROM performance
WHERE origin = 'ORD';

After creating tab bars and widgets the emulator gives such an error when opening the app [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I could not transfer my code to the site as I wrote it, but I placed your photo Please can you help me?
You are getting the error because you are trying to pass an uninitialized String to a Text-Widget (Naber). A Text-Widget can not handle uninitialized Strings which have the value null.
Therefore try initializing the String 'Naber' directly like:
String Naber = 'Some text';
This should work.

Flutter dart update array in Firestore [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have a problem with my code. I want to update an array in my Firestore database but this method doesn't work. I want rewrite the array every time:
this code doesn't work:
List<LineupModel> newLineup = List<LineupModel>();
var playerInField1 = LineupModel(playerId: 850, position: "0-0");
var playerInField2 = LineupModel(playerId: 870, position: "1-0");
newLineup.add(playerInField1);
newLineup.add(playerInField2);
FirebaseFirestore.instance.collection("users").doc("123").update({"lineup": []});
FirebaseFirestore.instance.collection("users").doc("123").update({"lineup": FieldValue.arrayUnion(newLineup)});
If I write the object directly, the update work correctly.
FirebaseFirestore.instance.collection("users").doc("123").update({"lineup": FieldValue.arrayUnion([{"playerId": 850, "position": "0-0"}, {"playerId": 870, "position": "1-0"}])});
This code also does not work
FirebaseFirestore.instance.collection("users").doc("123").update({"lineup": newLineup});
thanks a lot!
I have a way to solved this problem. I think you cant directly passed a List of Array on arrayUnion (not sure). The way I solved this, is to iterate the list and store them one by one. Theres also a batch upload like my example
newLineup.forEach((value) async {
await FirebaseFirestore.instance.collection("users").doc("123").set({
"lineup": FieldValue.arrayUnion([
value, //Make sure this is Map<String, dynamic> so that firestore can read it
])
}, SetOptions(merge: true));
});

Scala - parse phrase - parsing combinator or NLP? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I would like to answer questions such similar to these examples:
"23 jul cinema in Paris" --> returns the list of cinema shows in Paris for this date.
"23/07 cultural activities New Jersey" --> returns the list
"next week concert of classical music Spain" --> returns the list
How do I go about this? Should I use ScalaNLP, a parsing Combinator or something else?
My second question is how are date formats parsed?
Maluuba's Natural Language API may be helpful for you http://dev.maluuba.com/
It extracts important keywords and intents from sentences and returns them in an easily read format.
For the phrase "23 july cinema in Paris" the response is:
{
entities: {
dateRange: [
{
start: "2014-07-23",
end: "2014-07-24"
}
],
location: [
"paris"
],
theatre: [
"cinema"
]
},
action: "ENTERTAINMENT_MOVIE",
category: "ENTERTAINMENT"
}
It would be up to you to connect this to a movie data provider that has films for Paris.