Skip to content
Max Franks edited this page Jul 21, 2018 · 2 revisions

INSERT Statement

INSERT publishes an event to the database cluster. Each message is type checked against the data type the destination expects. Nested data types are allowed.

Events can be manipulated by either UDFs or built-in functions. The EACH keyword can be used to insert multiple messages at once.

Specification

INSERT [EACH]
    [ func(<document,>) | <document,> ]
    INTO <name>;

Examples


INSERT 1234 INTO LOG abc;
INSERT 3.141592653 INTO LOG abc;
INSERT 'This is a string' INTO LOG abc;
INSERT ['this','is','an','array'] INTO LOG abc;
INSERT { type: 'message', content: 'This is an object' } INTO LOG abc;

INSERT {
  type:'nested',
  content: {
    content: 'nested object',
    x:1,
    y: {str:'hi', str2:'there'},
    z:true
  }
} INTO LOG abc;

INSERT { ... } INTO LOG abc;

INSERT EACH [{...}, {...}, {...}, {...}] INTO LOG abc;

INSERT { type:'nested', content: { content: 'nested object', x:1, y: {str:'hi', str2:'there'}, z:true } } INTO LOG abc;

INSERT INTO LOG abc { type:'nested', content: { content: 'nested object', x:1, y: {str:'hi', str2:'there'}, z:true } };

INSERT type: 'nested', content.content: 'nested object', content.x: 1, content.y.str: 'hi', content.y.str2: 'there', content.z: true INTO LOG abc;

db.abc.insert({ type:'nested', content: { content: 'nested object', x:1, y: {str:'hi', str2:'there'}, z:true } })

Clone this wiki locally