/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free ** Documentation License version 1.3 as published by the Free Software ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements ** will be met: http://www.gnu.org/copyleft/fdl.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ /*! \title Qt JSON DB Reference \page qtjsondb-index.html \section1 Introduction JSON DB is a no-SQL object store for Qt. It allows JSON objects to be stored, modified and queried. It does not require schemas like SQL database, which makes it particularly flexible. It has a number of useful features such as the ability to mash-up data with database views, push notifications for data changes in the database, and easy integration with QML-based UIs. \section1 Accessing the Database. \section2 C++ API \generatelist annotatedclasses \section2 QML Elements \generatelist qmlclasses \section1 Using the Database \section2 Use of JSON The database operates on objects in JSON format. Any JSON object can be stored in the database, though JSON DB reserves properties beginning with an underscore for its own use. See \l {Special JSON Properties} \section2 Creating, Updating and Removing Objects Objects are manipulated in the database from C++ using the \l{QJsonDbWriteRequest} class and its associated convenience subclasses. In QML, objects are manipulated via the \l{Partition} item. \section2 Querying Objects Objects are queried from C++ using the \l{QJsonDbReadRequest} class and in QML using \l{Query} item. See \l {Queries} \section2 Partitions The database is sub-divided into a number of smaller partitions, each with its own unique name. All operations in JSON DB operate on exactly one partition at a time. See \l {Partitions} \section2 Indexes The index facility is provided to make queries perform better and to allow the database to sort the returned data. Indexes are created in JSON DB by creating objects with the type \c Index. See \l {Object Indexes} \section2 Views Views allow objects in JSON DB to be transformed and mashed-up into new objects. Views are defined via functions written in JavaScript and are automatically kept up to date by the database. When the source object of a view is modified in the database, JSON DB ensures the views that depend on that object are updated. Views in JSON DB are based heavily on the Map/Reduce concept (see \l {http://www.mapreduce.org}). Map functions are registered by creating an object of type \c Map in the database. See \l {Map and Join Views} Reduce functions are registered by creating an object of type \c Reduce in the database. See \l {Reduce Views} \section2 Notifications JSON DB clients can register to be informed about changes in the database via notifications. Clients create notifications containing a query to monitor. When an object matching the query is modified, JSON DB sends a notification message to the client. Notifications are registered via the \l {QJsonDbWatcher} class in C++ and via the \l {Notification} item in QML. See \l {Notifications} \section1 Examples \list \li \l{declarative/simplelistmodel}{Simple List Model} \li \l{declarative/streamingquery}{Streaming Query} \li \l{declarative/simpleindex}{Simple Object Indexing} \li \l{declarative/desktop-inspector}{Desktop Database Inspector Example} \li \l{declarative/map-phone}{Creating a Map View} \li \l{declarative/joinview}{Creating a Join View} \li \l{declarative/reduce-phone}{Creating a Reduce View} \li \l{client/chat}{Creating a chat client using the C++ API} \endlist */