V
V
vvrider2015-11-01 18:24:11
MongoDB
vvrider, 2015-11-01 18:24:11

How to insert variable into db.find({}) in meteor?

How to insert variable into db.find({}) in meteor ?

Template.resultsset.colresultsset = function () {
    return colresultsset.find( {"login":"great"}' );
    };

In the input form, the user enters a login, then in var = '$(".login").val()' I put the value entered by the user.
Now I would like to search by the login entered by the user in the database. Since several users can search the database at the same time, I would like the var for each session to store the data entered by them - then search for them.
I would like to do this, but apparently it does not work.
return colresultsset.find( {"login":"$(".login").val()"}'

Many thanks to everyone for the constructive advice!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Wolf, 2015-11-10
@mannaro

return colresultsset.find({ login: $(".login").val() })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question