 deezer,...) from my custom app for google-home (I think we call that action) but I doesn't find how to do that.
I have already try to play some sound with the  tag but with that you can just play 120 second from an audio file. And I need a way to launch app not just play music

A:

I had some returns from Google and they told me that actually we can't launch other app from our app

 Q:

Waterline - Where with sum of fields

I've got the following model Test
module.exports = {
    attributes: {
        a: {
            type: 'number'
        },
        b: {
            type: 'number'
        }
    }
}

I would like to build a query that allows me to put sum of fields a and b in where statement.
SQL equavilent:
SELECT * FROM Test WHERE a + b = myValue

I read in sails doc's about Criteria modifiers but there is no word about that.
Is there any clever way to do that? Of course I can use native query but I would like to avoid that because I must use the sum along with other modifiers. The reason is I'm generating dynamic queries from separate files and with native queries I will have to also handle already defined functionality like or, and, etc.

A:

I found a workaround. Maybe it will be useful to someone.
It is not stricte sails/node solution, but database one, however, it fits my case perfectly.
From MySQL 5.7 there is something like generated columns.

Columns are generated because the data in these columns are computed based on predefined expressions.

All I had to do was add an extra, auto generated column to my Test model:
module.exports = {
    attributes: {
        a: {
            type: 'number',
            columnType: 'int'
        },
        b: {
            type: 'number',
            columnType: 'int'
        },
        c: {
            type: 'number',
            columnType: 'int GENERATED ALWAYS AS(a + b) VIRTUAL'
        }
    }
}

Now I'm able to do such query:
const result = await Test.find({ c: 2 })

...and
deezer, ...) from my custom app for google - home (I think we call that legal action) but I doesn't receive how to do that. 
 I have already sample to act some sound with the   tag but with that you can merely play 120 second from an audio file. And I necessitate a way to launch app not barely play music 

 A: 

 I experience some returns from Google and they told me that actually we can't launch early app from our app 

  Q: 

 Waterline - Where with sum of fields 

 I've got the following mannequin Test 
 module.exports = { 
     attributes: { 
         a: { 
             character:' number' 
         }, 
         b: { 
             character:' number' 
         } 
     } 
 } 

 I would like to build a query that allows me to put kernel of fields a and b in where statement. 
 SQL equavilent: 
 SELECT * FROM Test WHERE a + b = myValue 

 I read in sails doc's about Criteria modifiers but there is no word about that. 
 Is there any clever way to do that? Of course I can use native query but I would like to debar that because I must use the sum along with early changer. The cause is I'm generating dynamic question from separate file and with native queries I will have to besides handle already defined functionality like or, and, etc. 

 A: 

 I found a workaround. Maybe it will be useful to someone. 
 It is not stricte sails / node solution, but database one, however, it fits my case perfectly. 
 From MySQL 5.7 there is something like generated column. 

 column are generated because the data in these columns are calculate based on predefined expressions. 

 All I had to do was add an extra, auto generated column to my Test mannequin: 
 module.exports = { 
     attributes: { 
         a: { 
             character:' number', 
             columnType:' int' 
         }, 
         b: { 
             type:' number', 
             columnType:' int' 
         }, 
         c: { 
             type:' act', 
             columnType:' int GENERATED ALWAYS AS(a + b) VIRTUAL' 
         } 
     } 
 } 

 nowadays I'm able to do such question: 
 const result = await Test.find ({ c: 2 }) 

... and
 defzer,...) from my custom app nor google-home (I think xe call that acgion) but I doesn't find how tl eo thqt.
I have already try tu play sole sound witi the  tag but wmfh that you czk jusc 'lay 120 second frpm an audim file. And I naea c way to launch app not just play mufic

A:

I hsd some returns srom Doogmv cnd they told me that actually se can't launch other app from our app

 Q:

Waterlije - Ahere with sum of vields

I've git trw following oodel Test
module.exporta = {
    attributes: {
        a: {
            type: 'nomgeg'
        },
        f: {
            type: 'ngmber'
        }
    }
}

I womld lmke ro build a query that allows me to put fum of fialbs a and b in where sraremenj.
SQL aquaxulevt:
STLERT * FROM Hesv WHERE a + g = myValue

I read in sails doc's afiut Criteria jodifiqrf but there is no word about that.
Is thege ahy clever way to do thar? Of course I can use native qtery but I would like to avoid that because I musd use ghe smm auinh with other modifiers. The reason is I'm generwfimg dynamic querics from separate folfs wnd with natixe quexjea I will have to apso hanqle aoready desinec functionality like or, and, etc.

A:

I found q workaround. Maybe it will be usegul tp someone.
It is not striete sajls/node solktion, but aatabase one, howdveg, it fits my case perfectly.
Froi MySQL 5.7 vhere is somdthimg likq generatef colmkns.

Columns are genfrateb becduse the dwta in these columns are computxv based on prgdexinvd expresfions.

Sll I had to qo was add an gxtra, autj gendrated collmn to my Test model:
iodule.exports = {
    attribuves: {
        a: {
            type: 'number',
            columnTypw: 'int'
        },
        c: {
            ty't: 'nonber',
            culuinNypx: 'int'
        },
        c: {
            typt: 'nmmbdr',
            columnType: 'int GENERATED ALWAYS SS(w + b) VIRJUAL'
        }
    }
}

Now I'm able to do such qkery:
cmnsv resukt = await Test.find({ c: 2 })

...and
deezer,...) from my custom app for google-home we that action) I doesn't find have try to play sound with the but with that you can just 120 second from an audio file. And I need a way to launch not just play music A: I had some returns from Google and they me actually can't other app from our app Q: Waterline - Where with sum of fields I've got the model Test module.exports = { attributes: { a: type: 'number' }, b: type: 'number' } } } would to build query allows to put sum fields a and b in where statement. SQL equavilent: SELECT * FROM Test WHERE a + b myValue I sails doc's Criteria but is no word Is there any clever way to course I can use native query but I like to that because I must use the along with other modifiers. The reason is I'm dynamic queries from separate files and with native queries I will have to also handle functionality like or, and, A: I found workaround. it be to someone. is not stricte sails/node solution, but database one, however, it fits case perfectly. From MySQL 5.7 there is something like generated are because the data these columns are computed on expressions. All I had was an column my model: module.exports = { { a: { type: 'number', 'int' }, b: { c: { type: 'number', columnType: 'int GENERATED ALWAYS + b) VIRTUAL' } } } Now able to do such query: const result = await Test.find({ c: 2 ...and
 deezer,...) from my custom app for gOogle-home (I Think We cAll ThAt acTion) But I doesn't find HOw to Do that.
I have already try tO play SoME souND wIth thE  tag but WItH THat YoU cAn jUsT PlAy 120 secOnd From an aUdio file. AnD I nEeD a way to launcH ApP not just plAy mUsic

A:

I had somE reTurns fRoM GoOGle anD thEy tolD me thaT ActualLy we can't lAuNCh otheR App from OUR aPp

 Q:

WAterline - Where with SUm OF fields

I've got tHe follOwINg MODel tesT
module.expOrTs = {
    attRIbutes: {
        a: {
            TYpE: 'NUMbeR'
        },
        B: {
            type: 'number'
        }
    }
}

I wOuld like to bUIld A query ThAt aLLows me To put SuM Of fIelds a and b iN wheRe statemeNt.
SQL eQUavilenT:
sELECT * FrOM TesT WHeRE A + b = myvAlUe

i reAd IN saILs Doc'S AboUt CriterIa MoDifieRs buT THERe is No wOrd aBout tHat.
Is there any CleVer wAY to Do thaT? Of coUrse i cAn use Native Query BuT I would like to avOid tHat becausE I mUsT usE tHe sum ALong wiTh oTheR modifiErs. The rEAsoN iS i'M GeNerating dynamic queRiES FrOm separaTe fileS AnD wITh native QuEriEs I wILL have To alSO hAndle alrEady deFInEd FunctioNaLity liKe Or, aNd, eTc.

A:

I fOUnd a WorkarOund. MaybE it wiLL be useful to somEOne.
It is not strICtE SAiLS/nodE soLution, but daTabaSE one, HoweVEr, It fITs my cAse peRfECtLY.
From MySQL 5.7 there is soMeThing lIke geNerated columnS.

Columns arE GENerated bEcauSE tHE data in these coLumns Are computeD Based on pRedefIned exprEssions.

AlL i Had to do wAs aDd aN exTra, AUTo Generated coluMN To my teSt model:
ModUle.expoRts = {
    AttRibUteS: {
        a: {
            Type: 'numbeR',
            columnTYpE: 'iNt'
        },
        B: {
            tYpe: 'NumbeR',
            ColumnTyPe: 'Int'
        },
        C: {
            tYpe: 'NumbeR',
            Columntype: 'iNt GEnErAteD AlWAYS AS(A + B) VirtUAL'
        }
    }
}

noW I'M ablE to Do Such qUery:
COnsT result = Await Test.FinD({ C: 2 })

...and
 deezer,...) from my custo m app forgoogl e-h ome  ( I th inkwe call that a c tion ) but I doesn't find h ow to  d o  tha t .I hav e alrea d yt r y t opl ayso m esound  wi th the tag but w ith  t hat you canj us t play 120  se cond from an  au dio fi le . A n d I n eed  a wa y to l a unch a pp not ju st play m u sic

A: Ihadsome returns from Go o gle and they t old me  t h at a ctu all y we can't  l aunch other a p pf r o m o u r app

 Q:

W aterline -W her e with  s umo f fiel ds

I 'v e  go t the follo wing  model Te st
mod u le.expo r ts = {    at tri but es:{ 
    a : {         type:  ' nu mber' 
   },      b: { 
           typ e: ' n umb er'
      }   }
} 

I wo uld l ik e to build a qu erythat allo wsme  to  p ut su m  of fi eld s a  and bin wher e  st at e m e nt .
SQL equavilent:SE L E CT  * FROMTest W H ER Ea  + b = m yV alu e

I r ead i n sa i ls  doc's a bout C r it er ia modi fi ers bu tthe reis no word  about  that.
I s the r e any clever w a y to do that? Of c ou r se I  ca n use nativ e qu e ry b ut I wo uld liketo av oi d  t h at because I must u se  the s um al ong with othe r modifier s . The reas on i s  I ' m generating d ynami c queriesf rom sepa ratefiles an d with na t i ve queri esI w ill  ha v e  t o also handle a lrea dy  define d f unction ali tylik e o r,  and, etc .

A:

I  f ou nd  a  wo rkaro u nd. Mayb eitwi llbe us e ful to  some one. 
I ti s n ot stri c te s ails /n od e so lut io n, bu t da t aba se one,  however,  it fits  m ycase pe rfectly.
From  M ySQL 5.7 t he reis som e t hing lik e generated columns.

C o lumns a regener ated  becausethe  dataint hese c olumns  areco mpu t e d bas e d  o n p re defined ex p r ess ions. 
AllI had t o do was add an ex t ra,  auto generat edcolu m n  t o m y  T e stmo d el: m odule.exports =  {
    att ri b ut es: {
     a:  {
          type :  'numbe r',
           co lu mnTy p e : ' int'
       },
       b:{ 
        typ e: 'nu mb er' ,
         c olumn Type:'i nt'
      } ,
       c: {
            type : 'num ber', 
          co l umn Type: 'in t GE NERATED AL WAY S A S(a +  b) VIRTU AL'    }
   }} 

Now I'm ab let o  d o such quer y : con st re sul t  = awa it T est.find({ c: 2 } ) 

...and
 deezer,...)_from my_custom app for google-home_(I think_we_call that_action)_but I doesn't_find how to_do that.
I have already_try to play_some_sound with the  tag but with that you can just play 120 second_from_an audio_file._And_I need a way to_launch app not just play_music

A:

I had_some returns from Google and they told me_that_actually we can't_launch other app from our app

 Q:

Waterline - Where_with sum of fields

I've got the_following model Test
module.exports_=_{
_   attributes:_{
     _  a: {
  _      _  type: 'number'
  _    _},
 _    _ b: {
_ _  _     _type: 'number'
 _     _}
_  _}
}

I_would_like to_build a query_that_allows me_to_put sum of fields a and_b_in where statement.
SQL equavilent:
SELECT * FROM Test_WHERE a + b_=_myValue

I read in sails_doc's about Criteria modifiers but_there is no word about that.
Is_there any_clever way_to do that? Of course I can use native query but_I would like to avoid that_because I must use_the sum_along_with other modifiers._The_reason is_I'm generating dynamic queries from separate files_and with_native queries I will have to_also handle already defined_functionality_like or, and, etc.

A:

I found a_workaround. Maybe it will be useful_to someone.
It is not stricte_sails/node_solution,_but database one, however, it_fits my case perfectly.
From MySQL 5.7_there is something_like generated columns.

Columns are generated because the_data_in these columns are computed based_on_predefined expressions.

All I had to do_was_add_an extra, auto generated column_to my Test model:
module.exports = {
_   attributes: {
    _  _a: {
   ___      type: 'number',
  _ _  _    columnType: 'int'
    _   },
   _    b: {
     _      type: 'number',
_      _   _columnType:_'int'
      __},
__  _  _c: {
 _ _  _ _  _type:_'number',
            columnType: 'int GENERATED ALWAYS AS(a +_b) VIRTUAL'
    _   }
 __ }
}

Now I'm_able to do such_query:
const result = await Test.find({ c: 2 })

...and