The
fields
argument refers to an object, object literal, or string
containing data that
will be inserted into the specified table. The fields
parameter specifies property names corresponding to columns
in the table schema, and values corresponding to the desired
values for each respective field name. The fields
argument does not have to specify every column in the
schema; behavior for omitted columns depends on which
method is being called. An exception is thrown if a specified
column name is not found.
Fields
may be specified in one of two ways. In the following examples, where "foo"
and "bar" are the column names and their associated
values are the entries in the table "MyTable":
1. |
Using
an object:
var fields = new object();
fields.foo = "fooValue";
fields.bar = "barValue";
Table.insert("MyTable", fields);
|
2. |
Using
an object literal:
Table.insert("MyTable",
{fooField:"fooValue", barField:"barValue"});
|
Related Topics Table.update(), Table.insert(), Table.bulkUpdate()
|