alasql


ALASQL: How to reference the JSON object it self (to call a function on it)?


I have the following object and I would like to call it's function.
[{a:1, fn:function(){} }]
Now I know if the object would be nested ([{a:1, b:{fn:function(){} } }]) that I could do b->fn() but how do I do it when it's direct property of the first element?
I tried just SELECT fn() FROM ... but that gives Uncaught SyntaxError: Unexpected token , (so not a proper parser error).
Please use _ variable. This is a pseudo-variable, which includes the record whole itself:
SELECT _->fn() FROM ...
You can see this jsFiddle example.

Related Links

AlaSQL can you use DISTINCT with SEARCH
Can one use CSV as an in-memory database with alasql?
Export the data to excel & formatting that as requirements
determining what array elements were removed
return alasql informational results
INSERT/UPDATE existing object?
How to insert data in google spreadsheet with tabletop?
How can I export to excel using alaql to multiple sheets AND have different display options for each sheet
AlaSQL saved database location
running two queries and then joining the results alasql promise notation
parent and child key in alasql rollup functions
Alasql select in arrary of array with uknown index
Alasql Best Practices
Alasql - Having columns with sub-columns
AlaSQL: Getting where opperands
ALASQL: How to reference the JSON object it self (to call a function on it)?

Categories

HOME
reactjs
http
kendo-ui-angular2
sql-server-2014
cluster-analysis
hex
salesforce-lightning
symfony-sonata
wavefront
google-api-oauth
restheart
dcos
openbsd
velocity
tracking
popup
luis
loss
nsoperation
powerpivot
jquery-easyui
aws-iot
android-wear-2.0
waterfall
my.cnf
multiple-inheritance
boosting
dynamics-ax-2012-r3
osgi-bundle
folder
paper-trail-gem
jboss-arquillian
log4net-configuration
jcr
android-scrollview
restler
cache-control
ponylang
javafxports
anypoint-studio
usernotifications
electron-packager
collation
definition
apiman
risc
activeandroid
opos
nao-robot
jcs
appcmd
bioperl
sharpssh
selection-sort
iban
blitz3d
copy-constructor
indoor-positioning-system
settext
xcode7.1
particle-system
user-profile
bluetooth-lowenergy-4.2
ewam
dynamics-nav-2013
ios8-share-extension
play-json
cloud-storage
dcg
cakephp-2.6
grails-3.0.9
httpmodule
screen-lock
esri-arc-engine
crystal-reports-7
formbuilder
powershell-v1.0
fscanf
atg-dynamo
cs193p
webshim
kernel-density
boofcv
adabas
svg-android
myrrix
zend-db-table
xrandr
symbian3
gwt2
setcookie
event-propagation
win-prolog
visual-leak-detector
web-search
pixel-bender

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile