getting an error when using readline with string input
up vote
0
down vote
favorite
I wrote this code that get an id and return values of database base on this id. i think every thing is ok but i get an error that:
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
^^^^^
SyntaxError: missing ) after argument list
and this is my code :
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
async function searchMoviesBaseonStarsAndDirector(imdbId) {
const res = await findObjectIdByImdbId(imdbId)
console.log('%%%',res)
const a = await Movie.find( { $or:[ {'stars':res}, {'director':res} ]})
return a
}
searchMoviesBaseonStarsAndDirector.then(function(result){
console.log('***********',result)
})
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
node.js mongoose
add a comment |
up vote
0
down vote
favorite
I wrote this code that get an id and return values of database base on this id. i think every thing is ok but i get an error that:
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
^^^^^
SyntaxError: missing ) after argument list
and this is my code :
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
async function searchMoviesBaseonStarsAndDirector(imdbId) {
const res = await findObjectIdByImdbId(imdbId)
console.log('%%%',res)
const a = await Movie.find( { $or:[ {'stars':res}, {'director':res} ]})
return a
}
searchMoviesBaseonStarsAndDirector.then(function(result){
console.log('***********',result)
})
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
node.js mongoose
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I wrote this code that get an id and return values of database base on this id. i think every thing is ok but i get an error that:
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
^^^^^
SyntaxError: missing ) after argument list
and this is my code :
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
async function searchMoviesBaseonStarsAndDirector(imdbId) {
const res = await findObjectIdByImdbId(imdbId)
console.log('%%%',res)
const a = await Movie.find( { $or:[ {'stars':res}, {'director':res} ]})
return a
}
searchMoviesBaseonStarsAndDirector.then(function(result){
console.log('***********',result)
})
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
node.js mongoose
I wrote this code that get an id and return values of database base on this id. i think every thing is ok but i get an error that:
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
^^^^^
SyntaxError: missing ) after argument list
and this is my code :
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
async function searchMoviesBaseonStarsAndDirector(imdbId) {
const res = await findObjectIdByImdbId(imdbId)
console.log('%%%',res)
const a = await Movie.find( { $or:[ {'stars':res}, {'director':res} ]})
return a
}
searchMoviesBaseonStarsAndDirector.then(function(result){
console.log('***********',result)
})
r1.question('enter Users imdb:', await searchMoviesBaseonStarsAndDirector(imdbId));
node.js mongoose
node.js mongoose
asked Nov 7 at 20:46
Fahom
275
275
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197554%2fgetting-an-error-when-using-readline-with-string-input%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown