Skip to content Skip to sidebar Skip to footer

Executing Queries In Mongodb With Greek Characters Using Javascript Returns No Results

I am building an HTML5 app combining the AngularJS framework and MongoDB. The setup is similar to the ‘Wire up a backend’ demo in the AngularJS home page. So far, I have manage

Solution 1:

Works for me from the shell (I copied your example document to insert, and then copied from the query for name), so at least you're not having one of those issues where the utf-8 characters look the same but are slightly different:

> db.test.insert({ "name": "Νίκος", "value": 1.35});
> db.test.find({name: "Νίκος"});
{ "_id" : ObjectId("4f9b1642c26c79dac82740c5"), "name" : "Νίκος", "value" : 1.35 }

Double check your file encoding on the js file? Although, I'm sure in your real program, you have that search value coming from a URL encoded form through GET or POST, so the encoding on the js file wouldn't matter.

You might try setting accept-charset="utf-8" in your form. If it's AJAX or posted through JS via the angular bindings, make sure that the character encoding is set before you send it as well. Something like this? http://groups.google.com/group/angular/browse_thread/thread/e6701e749d4bc8ed

Post a Comment for "Executing Queries In Mongodb With Greek Characters Using Javascript Returns No Results"