TypeError: attr[0].indexOf is not a functionUnable to create child instance for one-to-many on Sequelize.jsSequelize TypeError build.save is not a functionMany to many self reference in Sequelize in twitter like web-appTypeError: defineCall is not a function at Sequelize.importSequelize findOne error: TypeError indexOf undefinedSequelize not accepting valid moment.js object in where clauseCannot read property 'source' of undefined when trying to add association in queryGenerator.SelectQuery in Sequelize ORMModel.create with hasTrigger true return typeError attribute.type.toSql is not a functionDynamically add attributes to sequelize.js queryTypeError: UserModel.create is not a function, Sequelize
Upper Bound for a Sum
how to change dot to underline in multiple file-names?
Why is it to say 'paucis post diebus'?
Is there a command-line tool for converting html files to pdf?
How to increase Solr JVM memory
Why wasn't interlaced CRT scanning done back and forth?
Are valid inequalities worth the effort given modern solver preprocessing options?
The warlock of firetop mountain, what's the deal with reference 192?
Write The Shortest Program To Check If A Binary Tree Is Balanced
Variable doesn't parse as string
Does a humanoid possessed by a ghost register as undead to a paladin's Divine Sense?
Can a Sikh enter a buddhist temple with a turban?
How do the surviving Asgardians get to Earth?
Why is Heisenberg shown dead in Negro y Azul?
If someone else uploads my GPL'd code to Github without my permission, is that a copyright violation?
ZFS on Linux: Which mountpoint option when mounting manually per script?
“The Fourier transform cannot measure two phases at the same frequency.” Why not?
Is a switch from R to Python worth it?
Pronouns when writing from the point of view of a robot
Need reasons why a satellite network would not work
Would this winged human/angel be able to fly?
Piece de Resistance - Introduction & Ace and A's
Did Logical Positivism fail because it simply denied human emotion?
Repeated! Factorials!
TypeError: attr[0].indexOf is not a function
Unable to create child instance for one-to-many on Sequelize.jsSequelize TypeError build.save is not a functionMany to many self reference in Sequelize in twitter like web-appTypeError: defineCall is not a function at Sequelize.importSequelize findOne error: TypeError indexOf undefinedSequelize not accepting valid moment.js object in where clauseCannot read property 'source' of undefined when trying to add association in queryGenerator.SelectQuery in Sequelize ORMModel.create with hasTrigger true return typeError attribute.type.toSql is not a functionDynamically add attributes to sequelize.js queryTypeError: UserModel.create is not a function, Sequelize
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
While querying through sequelize:
where["tenant_id"] = tenant_id;
where[datecheck] =
$gte: from,
$lte: to,
$ne: null
;
group = [ group_by + '_id' , "stage_type"];
attributes = [[group_by + '_id', 'id'], [group_by + '_name', 'group'], ["stage_type", 'type'], [ sequelize.literal('SUM(`stage_value`)'), 'count']];
Model.findAll(
attributes: attributes,
where: where,
group: group
);
I get this error:
Data TypeError: attr[0].indexOf is not a function
at attributes.map.attr (
sequelize/lib/dialects/abstract/query-generator.js:1244:28)
sequelize.js
add a comment |
While querying through sequelize:
where["tenant_id"] = tenant_id;
where[datecheck] =
$gte: from,
$lte: to,
$ne: null
;
group = [ group_by + '_id' , "stage_type"];
attributes = [[group_by + '_id', 'id'], [group_by + '_name', 'group'], ["stage_type", 'type'], [ sequelize.literal('SUM(`stage_value`)'), 'count']];
Model.findAll(
attributes: attributes,
where: where,
group: group
);
I get this error:
Data TypeError: attr[0].indexOf is not a function
at attributes.map.attr (
sequelize/lib/dialects/abstract/query-generator.js:1244:28)
sequelize.js
Can you share the raw query that is getting executed?
– Rohit Dalal
Mar 27 at 5:15
SELECTtenant_id
ASid
,tenant_name
ASgroup
,stage_type
AStype
, COUNT(candidate_id
) AScount
FROMfunnel_reports
ASfunnel_reports
WHEREfunnel_reports
.tenant_id
= '10' AND (funnel_reports
.stage_date
>= '2018-05-31 18:30:00' ANDfunnel_reports
.stage_date
<= '2019-02-28 18:30:00') GROUP BYtenant_id
,stage_type
;
– Pragna
Mar 27 at 6:58
That query I want to run through sequelize but it is throwing an error. I am using sequelize 4.38.0 version
– Pragna
Mar 27 at 6:59
add a comment |
While querying through sequelize:
where["tenant_id"] = tenant_id;
where[datecheck] =
$gte: from,
$lte: to,
$ne: null
;
group = [ group_by + '_id' , "stage_type"];
attributes = [[group_by + '_id', 'id'], [group_by + '_name', 'group'], ["stage_type", 'type'], [ sequelize.literal('SUM(`stage_value`)'), 'count']];
Model.findAll(
attributes: attributes,
where: where,
group: group
);
I get this error:
Data TypeError: attr[0].indexOf is not a function
at attributes.map.attr (
sequelize/lib/dialects/abstract/query-generator.js:1244:28)
sequelize.js
While querying through sequelize:
where["tenant_id"] = tenant_id;
where[datecheck] =
$gte: from,
$lte: to,
$ne: null
;
group = [ group_by + '_id' , "stage_type"];
attributes = [[group_by + '_id', 'id'], [group_by + '_name', 'group'], ["stage_type", 'type'], [ sequelize.literal('SUM(`stage_value`)'), 'count']];
Model.findAll(
attributes: attributes,
where: where,
group: group
);
I get this error:
Data TypeError: attr[0].indexOf is not a function
at attributes.map.attr (
sequelize/lib/dialects/abstract/query-generator.js:1244:28)
sequelize.js
sequelize.js
edited Apr 1 at 20:07
marc_s
599k135 gold badges1149 silver badges1285 bronze badges
599k135 gold badges1149 silver badges1285 bronze badges
asked Mar 27 at 2:51
PragnaPragna
14 bronze badges
14 bronze badges
Can you share the raw query that is getting executed?
– Rohit Dalal
Mar 27 at 5:15
SELECTtenant_id
ASid
,tenant_name
ASgroup
,stage_type
AStype
, COUNT(candidate_id
) AScount
FROMfunnel_reports
ASfunnel_reports
WHEREfunnel_reports
.tenant_id
= '10' AND (funnel_reports
.stage_date
>= '2018-05-31 18:30:00' ANDfunnel_reports
.stage_date
<= '2019-02-28 18:30:00') GROUP BYtenant_id
,stage_type
;
– Pragna
Mar 27 at 6:58
That query I want to run through sequelize but it is throwing an error. I am using sequelize 4.38.0 version
– Pragna
Mar 27 at 6:59
add a comment |
Can you share the raw query that is getting executed?
– Rohit Dalal
Mar 27 at 5:15
SELECTtenant_id
ASid
,tenant_name
ASgroup
,stage_type
AStype
, COUNT(candidate_id
) AScount
FROMfunnel_reports
ASfunnel_reports
WHEREfunnel_reports
.tenant_id
= '10' AND (funnel_reports
.stage_date
>= '2018-05-31 18:30:00' ANDfunnel_reports
.stage_date
<= '2019-02-28 18:30:00') GROUP BYtenant_id
,stage_type
;
– Pragna
Mar 27 at 6:58
That query I want to run through sequelize but it is throwing an error. I am using sequelize 4.38.0 version
– Pragna
Mar 27 at 6:59
Can you share the raw query that is getting executed?
– Rohit Dalal
Mar 27 at 5:15
Can you share the raw query that is getting executed?
– Rohit Dalal
Mar 27 at 5:15
SELECT
tenant_id
AS id
, tenant_name
AS group
, stage_type
AS type
, COUNT(candidate_id
) AS count
FROM funnel_reports
AS funnel_reports
WHERE funnel_reports
.tenant_id
= '10' AND (funnel_reports
.stage_date
>= '2018-05-31 18:30:00' AND funnel_reports
.stage_date
<= '2019-02-28 18:30:00') GROUP BY tenant_id
, stage_type
;– Pragna
Mar 27 at 6:58
SELECT
tenant_id
AS id
, tenant_name
AS group
, stage_type
AS type
, COUNT(candidate_id
) AS count
FROM funnel_reports
AS funnel_reports
WHERE funnel_reports
.tenant_id
= '10' AND (funnel_reports
.stage_date
>= '2018-05-31 18:30:00' AND funnel_reports
.stage_date
<= '2019-02-28 18:30:00') GROUP BY tenant_id
, stage_type
;– Pragna
Mar 27 at 6:58
That query I want to run through sequelize but it is throwing an error. I am using sequelize 4.38.0 version
– Pragna
Mar 27 at 6:59
That query I want to run through sequelize but it is throwing an error. I am using sequelize 4.38.0 version
– Pragna
Mar 27 at 6:59
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f55369073%2ftypeerror-attr0-indexof-is-not-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f55369073%2ftypeerror-attr0-indexof-is-not-a-function%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
Can you share the raw query that is getting executed?
– Rohit Dalal
Mar 27 at 5:15
SELECT
tenant_id
ASid
,tenant_name
ASgroup
,stage_type
AStype
, COUNT(candidate_id
) AScount
FROMfunnel_reports
ASfunnel_reports
WHEREfunnel_reports
.tenant_id
= '10' AND (funnel_reports
.stage_date
>= '2018-05-31 18:30:00' ANDfunnel_reports
.stage_date
<= '2019-02-28 18:30:00') GROUP BYtenant_id
,stage_type
;– Pragna
Mar 27 at 6:58
That query I want to run through sequelize but it is throwing an error. I am using sequelize 4.38.0 version
– Pragna
Mar 27 at 6:59