-1

Example: I want to save something like this.

db.collectionname.insert([
{
    Language:"Tamil",
    Chapter:"CHP1",
    Questions:[
            {
                Question: "ஒரு மின்காந்த அலை ஒரு ஊடகத்தின் வழியே □(→┬V )=Vi ̂ திசைவேகத்தில் பரவுகிறது. அந்த கனத்தில் மின்காந்த அலையின் மின்புலம் +y அச்சில் அலைவுறுகிறது எனில் , அலைவுறும் காந்தபுலத்தின் திசை ",
                Answer: [
                    "+Z திசையில்"
                    "-y திசையில்",
                    "-Z திசையில்",
                    "-x திசையில் "
                ],
                CorrectAnswer: "-x திசையில் ",
                Explanation:"-x திசையில் "
            }
        ]
    }
])
dnickless
  • 10,733
  • 1
  • 19
  • 34
Ashok K
  • 26
  • 4

1 Answers1

0

You're missing a comma in your Answer array, the following works:

db.collectionname.insert([
{
    Language:"Tamil",
    Chapter:"CHP1",
    Questions:[
            {
                Question: "ஒரு மின்காந்த அலை ஒரு ஊடகத்தின் வழியே □(→┬V )=Vi ̂ திசைவேகத்தில் பரவுகிறது. அந்த கனத்தில் மின்காந்த அலையின் மின்புலம் +y அச்சில் அலைவுறுகிறது எனில் , அலைவுறும் காந்தபுலத்தின் திசை ",
                Answer: [
                    "+Z திசையில்",
                    "-y திசையில்",
                    "-Z திசையில்",
                    "-x திசையில் "
                ],
                CorrectAnswer: "-x திசையில் ",
                Explanation:"-x திசையில் "
            }
        ]
    }
])
dnickless
  • 10,733
  • 1
  • 19
  • 34
  • Thanks dnickless. Its working. Note: If I fetch the data in mongo shell after insertion, the documents are displayed as "??????" (i.e Question marks). But if I retrieve the data using mongoose and display in UI, it showing the actual information/data. – Ashok K Oct 15 '18 at 12:59
  • @AshokK, that behaviour is caused by your console window rather than the mongo client. See this for more information: https://stackoverflow.com/questions/388490/how-to-use-unicode-characters-in-windows-command-line/15858812 – dnickless Oct 15 '18 at 18:23