TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
durgaprasad rapolu
NA
57
8.8k
How to get the values from MongoDB for user inputs
May 8 2019 1:15 AM
Hi I am creating collection(table) in mongodb like this;
DateBase name: Sample
Collection name: Sales
Id : xxxxxxxxxxxxx
India:1,23,456
Usa: 2,34,794
Asia:12,34,689
Now i want to get the values for user inputs dynamically
I am trying this code :
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["sample"]
mycol = mydb["sales"]
loc = tracker.get_slot('location') // Inside the location values is India is stored in loc
counterNumber = mycol.count()
gettingTotalSize = mycol.find({}, {"_id": 0, "loc": 1})
for x in gettingTotalSize:
dispatcher.utter_message(str(x["loc"]))
return []
Reply
Answers (
1
)
What is pig and sqoop?
What do i have to check to fix this?