All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.polymer.app.AppPouchdbQueryElement Maven / Gradle / Ivy

The newest version!
/*
 * This code was generated with Vaadin Web Component GWT API Generator, 
 * from app-pouchdb project by The Polymer Authors
 * that is licensed with http://polymer.github.io/LICENSE.txt license.
 */
package com.vaadin.polymer.app;

import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;

/**
 * 

app-pouchdb-query allows for declarative, read-only querying into a PouchDB
database. The semantics for querying match those of the
pouchdb-find plugin.

*

In order to create an app-pouchdb-query against any field other than _id, at
least one index needs to have been created in your PouchDB database. You can use
app-pouchdb-index to do this declaratively. For example:

*
<app-pouchdb-index
 *     db-name="cats"
 *     fields='["name"]'>
 * </app-pouchdb-index>
 * <app-pouchdb-query
 *     db-name="cats"
 *     selector="name $exists true"
 *     fields='["_id","name"]'
 *     sort='["name"]'
 *     data="{{cats}}">
 * </app-pouchdb-query>
 * 
*

In the above example, an index is created on the “name” field of the “cats”
database. This allows the query to select by the “name” field, and sort by the
“name” field.

*

By default, PouchDB creates an index on the “_id” field, so if you don’t
particularly care about sorting or selecting on other fields, you don’t need to
create any extra indexes.

*

Describing selectors

*

This element requires a specialized selector syntax that maps to the semantics
of the pouchdb-find plugin. For example, if you wish to create the following
selector:

*
{
 *   series: 'Mario',
 *   debut: { $gt: 1990 }
 * }
 * 
*

You should format the selector property this way:

*
"series $eq 'Mario', debut $gt 1990"
 * 
*

This makes selectors more convenient to write declaratively, while still
maintaining the ability to express selectors with full fidelity. For more
documentation on pouchdb-find selectors, please check out the docs
here.

*/ @JsType(isNative=true) public interface AppPouchdbQueryElement extends HTMLElement { @JsOverlay public static final String TAG = "app-pouchdb-query"; @JsOverlay public static final String SRC = "app-pouchdb/app-pouchdb-query.html"; /** *

If true, all attempts to “put” or “post” values into the database
will be automatically structured as an “upsert”, where documents are
updated if already available, or created if not.

* * JavaScript Info: * @property upsert * @type Boolean * @behavior AppPouchdbQuery */ @JsProperty boolean getUpsert(); /** *

If true, all attempts to “put” or “post” values into the database
will be automatically structured as an “upsert”, where documents are
updated if already available, or created if not.

* * JavaScript Info: * @property upsert * @type Boolean * @behavior AppPouchdbQuery */ @JsProperty void setUpsert(boolean value); /** *

The fields to include in the returned documents.

* * JavaScript Info: * @property fields * @type Array * */ @JsProperty JsArray getFields(); /** *

The fields to include in the returned documents.

* * JavaScript Info: * @property fields * @type Array * */ @JsProperty void setFields(JsArray value); /** *

The results of the query, if any.

* * JavaScript Info: * @property data * @type Array * */ @JsProperty JsArray getData(); /** *

The results of the query, if any.

* * JavaScript Info: * @property data * @type Array * */ @JsProperty void setData(JsArray value); /** *

If desired, assign a function that implements a conflict resolution
strategy. This conflict resolution strategy will take precedence when
a conflict occurs, and will prevent conflict notification events from
being fired.

*

Consider using an app-pouchdb-conflict-resolver element instead for
a more declarative experience!

* * JavaScript Info: * @property resolveConflict * @type Function * @behavior AppPouchdbQuery */ @JsProperty Function getResolveConflict(); /** *

If desired, assign a function that implements a conflict resolution
strategy. This conflict resolution strategy will take precedence when
a conflict occurs, and will prevent conflict notification events from
being fired.

*

Consider using an app-pouchdb-conflict-resolver element instead for
a more declarative experience!

* * JavaScript Info: * @property resolveConflict * @type Function * @behavior AppPouchdbQuery */ @JsProperty void setResolveConflict(Function value); /** *

A list of field names to sort by. Fields in this list must have
indexes created for them.

* * JavaScript Info: * @property sort * @type Array * */ @JsProperty JsArray getSort(); /** *

A list of field names to sort by. Fields in this list must have
indexes created for them.

* * JavaScript Info: * @property sort * @type Array * */ @JsProperty void setSort(JsArray value); /** *

An object representing the parsed form of the selector, mapping to
a valid selector value as described in
the pouchdb-find docs.

* * JavaScript Info: * @property parsedSelector * @type Object * */ @JsProperty JavaScriptObject getParsedSelector(); /** *

An object representing the parsed form of the selector, mapping to
a valid selector value as described in
the pouchdb-find docs.

* * JavaScript Info: * @property parsedSelector * @type Object * */ @JsProperty void setParsedSelector(JavaScriptObject value); /** *

A configuration object suitable to be passed to the find method of
the PouchDB database. For more information, refer to the docs
here

* * JavaScript Info: * @property query * @type Object * */ @JsProperty JavaScriptObject getQuery(); /** *

A configuration object suitable to be passed to the find method of
the PouchDB database. For more information, refer to the docs
here

* * JavaScript Info: * @property query * @type Object * */ @JsProperty void setQuery(JavaScriptObject value); /** *

A reference to the PouchDB database instance that has been created.

* * JavaScript Info: * @property db * @type Object * @behavior AppPouchdbQuery */ @JsProperty JavaScriptObject getDb(); /** *

A reference to the PouchDB database instance that has been created.

* * JavaScript Info: * @property db * @type Object * @behavior AppPouchdbQuery */ @JsProperty void setDb(JavaScriptObject value); /** *

The number of documents to skip before returning results that match
the query. In other words, the offset from the beginning of the
of the result set to start at.

* * JavaScript Info: * @property skip * @type Number * */ @JsProperty double getSkip(); /** *

The number of documents to skip before returning results that match
the query. In other words, the offset from the beginning of the
of the result set to start at.

* * JavaScript Info: * @property skip * @type Number * */ @JsProperty void setSkip(double value); /** *

The number of document revisions to keep track of. The default value
(0) indicates no limit.

* * JavaScript Info: * @property revsLimit * @type Number * @behavior AppPouchdbQuery */ @JsProperty double getRevsLimit(); /** *

The number of document revisions to keep track of. The default value
(0) indicates no limit.

* * JavaScript Info: * @property revsLimit * @type Number * @behavior AppPouchdbQuery */ @JsProperty void setRevsLimit(double value); /** *

The maximum number of documents that can be returned. The default (0)
specifies no limit.

* * JavaScript Info: * @property limit * @type Number * */ @JsProperty double getLimit(); /** *

The maximum number of documents that can be returned. The default (0)
specifies no limit.

* * JavaScript Info: * @property limit * @type Number * */ @JsProperty void setLimit(double value); /** *

The PouchDB adapter to use. For more information on PouchDB adapters,
please refer to the PouchDB documentation
here.

* * JavaScript Info: * @property adapter * @type String * @behavior AppPouchdbQuery */ @JsProperty String getAdapter(); /** *

The PouchDB adapter to use. For more information on PouchDB adapters,
please refer to the PouchDB documentation
here.

* * JavaScript Info: * @property adapter * @type String * @behavior AppPouchdbQuery */ @JsProperty void setAdapter(String value); /** *

The name of the database. This can be either a local database (such
as “cats”), or a remote one (e.g., “https://example.com:5678/cats“).

* * JavaScript Info: * @property dbName * @type String * @behavior AppPouchdbQuery */ @JsProperty String getDbName(); /** *

The name of the database. This can be either a local database (such
as “cats”), or a remote one (e.g., “https://example.com:5678/cats“).

* * JavaScript Info: * @property dbName * @type String * @behavior AppPouchdbQuery */ @JsProperty void setDbName(String value); /** *

The selector to use when querying for documents. Fields referenced
in the selector must have indexes created for them.

* * JavaScript Info: * @property selector * @type String * */ @JsProperty String getSelector(); /** *

The selector to use when querying for documents. Fields referenced
in the selector must have indexes created for them.

* * JavaScript Info: * @property selector * @type String * */ @JsProperty void setSelector(String value); /** *

PouchDB only notifies of additive changes to the result set of a query.
In order to keep the query results up to date with other types of
changes, this method can be called to perform the query again without
changing any of this element’s other properties.

* * JavaScript Info: * @method refresh * * */ void refresh(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy