I have data like:
{ title : "Moby-Dick" ,
author : "Herman Melville" ,
published : 1851 ,
ISBN : 0451526996 ,
topics : [ "whaling" , "allegory" , "revenge" , "American" ,
"novel" , "nautical" , "voyage" , "Cape Cod" ]
}
I want to create index on topics like:
db.volumes.createIndex( { topics: 1 } )
How to use pymongo to create mongodb like this?