क्लाइंट और सर्वर-साइड डेवलपमेंट के लिए, Google Cloud इंफ़्रास्ट्रक्चर पर बनाए गए हमारे फ़्लेक्सिबल और बढ़ाए जा सकने वाले NoSQL क्लाउड डेटाबेस का इस्तेमाल करें. इससे डेटा को सेव और सिंक किया जा सकता है.
Cloud Firestore, Firebase और Google Cloud का एक फ़्लेक्सिबल और स्केलेबल डेटाबेस है. इसका इस्तेमाल मोबाइल, वेब, और सर्वर डेवलपमेंट के लिए किया जाता है. Firebase Realtime Database की तरह, यह रीयलटाइम लिसनर की मदद से, क्लाइंट ऐप्लिकेशन पर आपके डेटा को सिंक करता है. साथ ही, मोबाइल और वेब के लिए ऑफ़लाइन सहायता उपलब्ध कराता है, ताकि आप ऐसे ऐप्लिकेशन बना सकें जो नेटवर्क की लेटेन्सी या इंटरनेट कनेक्टिविटी की परवाह किए बिना काम करते हैं. Cloud Firestore, Cloud Functions के साथ-साथ अन्य Firebase और Google Cloud प्रॉडक्ट के साथ आसानी से इंटिग्रेट हो जाता है.
Cloud Firestore डेटा मॉडल, डेटा के स्ट्रक्चर को ज़रूरत के हिसाब से बदलने और उन्हें क्रम में लगाने की सुविधा देता है.
अपने डेटा को दस्तावेज़ों में सेव करें. इन दस्तावेज़ों को कलेक्शन में व्यवस्थित किया जाता है. दस्तावेज़ों में सब-कलेक्शन के साथ-साथ, नेस्ट किए गए जटिल ऑब्जेक्ट भी शामिल हो सकते हैं.
एक्सप्रेसिव क्वेरी
Cloud Firestore में, क्वेरी का इस्तेमाल करके अलग-अलग और खास दस्तावेज़ों को वापस पाया जा सकता है. इसके अलावा, क्वेरी पैरामीटर से मेल खाने वाले किसी कलेक्शन के सभी दस्तावेज़ों को वापस पाया जा सकता है. आपकी क्वेरी में एक साथ कई फ़िल्टर इस्तेमाल किए जा सकते हैं. साथ ही, फ़िल्टर करने और क्रम से लगाने की सुविधा का इस्तेमाल किया जा सकता है.
रीयलटाइम अपडेट
Realtime Database की तरह, Cloud Firestore भी डेटा सिंक करने की सुविधा का इस्तेमाल करता है, ताकि कनेक्ट किए गए किसी भी डिवाइस पर डेटा अपडेट किया जा सके. हालांकि, इसे एक बार में फ़ेच की जाने वाली क्वेरी को आसानी से और असरदार तरीके से प्रोसेस करने के लिए भी डिज़ाइन किया गया है.
ऑफ़लाइन सहायता
Cloud Firestore उस डेटा को कैश मेमोरी में सेव करता है जिसका इस्तेमाल आपका ऐप्लिकेशन कर रहा है. इससे ऐप्लिकेशन, डिवाइस के ऑफ़लाइन होने पर भी डेटा को लिख सकता है, पढ़ सकता है, सुन सकता है, और क्वेरी कर सकता है. जब डिवाइस फिर से ऑनलाइन होता है, तब Cloud Firestore स्थानीय बदलावों को वापस Cloud Firestore के साथ सिंक करता है.
बड़े पैमाने पर इस्तेमाल करने के लिए डिज़ाइन किया गया
Cloud Firestore आपको Google Cloud के बेहतरीन और दमदार इन्फ़्रास्ट्रक्चर की सुविधाएं देता है: एक से ज़्यादा क्षेत्रों में डेटा अपने-आप कॉपी होने की सुविधा, डेटा में लगातार बदलाव होने की गारंटी, ऐटॉमिक बैच ऑपरेशन, और ACID ट्रांज़ैक्शन की सुविधा. हमने Cloud Firestore को दुनिया के सबसे बड़े ऐप्लिकेशन के सबसे मुश्किल डेटाबेस वर्कलोड को हैंडल करने के लिए डिज़ाइन किया है.
MongoDB के साथ काम करता है या नहीं
Cloud Firestore, MongoDB के साथ काम करने वाला एपीआई उपलब्ध कराता है. Enterprise edition में, MongoDB के मौजूदा ऐप्लिकेशन कोड, ड्राइवर, टूल, और MongoDB इंटिग्रेशन के ओपन-सोर्स इकोसिस्टम का इस्तेमाल किया जा सकता है.Cloud Firestore
यह कैसे काम करता है?
Cloud Firestore, क्लाउड पर होस्ट किया गया NoSQL डेटाबेस है. इसे Apple, Android, और वेब ऐप्लिकेशन सीधे तौर पर नेटिव SDK टूल के ज़रिए ऐक्सेस कर सकते हैं. Cloud Firestore, REST और RPC एपीआई के अलावा, नेटिव Node.js, Java, Python, Unity, C++, और Go SDK टूल में भी उपलब्ध है.
Cloud Firestore के दस्तावेज़ डेटा मॉडल के मुताबिक, आपको ऐसा डेटा सेव करना होता है जिसमें वैल्यू के साथ मैप किए गए फ़ील्ड शामिल हों. ये दस्तावेज़ कलेक्शन में सेव किए जाते हैं. कलेक्शन, आपके दस्तावेज़ों के लिए कंटेनर होते हैं. इनका इस्तेमाल, अपने डेटा को व्यवस्थित करने और क्वेरी बनाने के लिए किया जा सकता है. दस्तावेज़ों में कई तरह के डेटा टाइप इस्तेमाल किए जा सकते हैं. जैसे, सामान्य स्ट्रिंग और संख्याएं, जटिल, नेस्ट किए गए ऑब्जेक्ट. दस्तावेज़ों में सब-कलेक्शन भी बनाए जा सकते हैं. साथ ही, क्रम के हिसाब से डेटा स्ट्रक्चर बनाए जा सकते हैं. ये डेटा स्ट्रक्चर, डेटाबेस के बढ़ने के साथ-साथ स्केल होते हैं. Cloud Firestoreडेटा मॉडल, आपके ऐप्लिकेशन के लिए सबसे सही काम करने वाले डेटा स्ट्रक्चर के साथ काम करता है.
इसके अलावा, Cloud Firestore में क्वेरी करना आसान, असरदार, और सुविधाजनक होता है.
डॉक्यूमेंट लेवल पर डेटा वापस पाने के लिए, शैलो क्वेरी बनाएं. इसके लिए, आपको पूरे कलेक्शन या किसी नेस्ट किए गए सब-कलेक्शन को वापस पाने की ज़रूरत नहीं है. अपने नतीजों को पेज के हिसाब से बांटने के लिए, अपनी क्वेरी या कर्सर में क्रम से लगाने, फ़िल्टर करने, और सीमाएं तय करने की सुविधा जोड़ें. अपने ऐप्लिकेशन में डेटा को अप-टू-डेट रखने के लिए, रीयलटाइम लिसनर जोड़ें. इससे, हर बार अपडेट होने पर आपको पूरा डेटाबेस वापस नहीं पाना पड़ेगा.
अपने ऐप्लिकेशन में रीयलटाइम में सुनने वाले लोगों की संख्या जोड़ने पर, आपको डेटा स्नैपशॉट के साथ सूचना मिलती है. ऐसा तब होता है, जब आपके क्लाइंट ऐप्लिकेशन जिस डेटा को सुन रहे हैं उसमें बदलाव होता है. इससे सिर्फ़ नए बदलावों को वापस पाया जा सकता है.
Android, Apple प्लैटफ़ॉर्म, और JavaScript के लिए, Firebase Authentication और Cloud Firestore Security Rules का इस्तेमाल करके, Cloud Firestore में मौजूद अपने डेटा को सुरक्षित रखें. इसके अलावा, सर्वर-साइड भाषाओं के लिए, पहचान और ऐक्सेस मैनेजमेंट (आईएएम) का इस्तेमाल करें.
लागू करने का तरीका
Cloud Firestore एसडीके टूल इंटिग्रेट करना
Gradle, CocoaPods या स्क्रिप्ट शामिल करने की सुविधा का इस्तेमाल करके, क्लाइंट को तुरंत शामिल करें.
अपने डेटा को सुरक्षित रखना
मोबाइल/वेब और सर्वर डेवलपमेंट के लिए, अपने डेटा को सुरक्षित रखने के लिए Cloud Firestore Security Rules या Identity and Access Management (IAM) का इस्तेमाल करें.
डेटा जोड़ें
अपने डेटाबेस में दस्तावेज़ और कलेक्शन बनाएं.
डेटा पाना
डेटाबेस से डेटा वापस पाने के लिए, क्वेरी बनाएं या रीयलटाइम लिसनर का इस्तेमाल करें.
अगले चरण
Cloud Firestore का इस्तेमाल शुरू करें — अपना डेटाबेस सेट अप करें. इसके बाद, डेटा जोड़ें और उसे पढ़ना शुरू करें.
Cloud Firestoreडेटा मॉडल के बारे में ज़्यादा जानें.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-09-04 (UTC) को अपडेट किया गया."],[],[],null,["Cloud Firestore \nplat_ios plat_android plat_web plat_flutter plat_cpp plat_unity plat_node plat_java plat_python plat_go \nUse our flexible, scalable NoSQL cloud database, built\non Google Cloud infrastructure, to store and sync data for client- and\nserver-side development. \n\nCloud Firestore is a flexible, scalable database for mobile, web,\nand server development from Firebase and Google Cloud. Like\nFirebase Realtime Database, it keeps your data in sync across client apps through\nrealtime listeners and offers offline support for mobile and web so you can\nbuild responsive apps that work regardless of network latency or Internet\nconnectivity. Cloud Firestore also offers seamless integration with other Firebase\nand Google Cloud products, including Cloud Functions.\n\nCloud Firestore is available in two editions to meet different needs.\n[Learn about the editions](/docs/firestore/editions)\n\nKey capabilities\n\n|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Flexibility | The Cloud Firestore data model supports flexible, hierarchical data structures. Store your data in documents, organized into collections. Documents can contain complex nested objects in addition to subcollections. |\n| Expressive querying | In Cloud Firestore, you can use queries to retrieve individual, specific documents or to retrieve all the documents in a collection that match your query parameters. Your queries can include multiple, chained filters and combine filtering and sorting. |\n| Realtime updates | Like Realtime Database, Cloud Firestore uses data synchronization to update data on any connected device. However, it's also designed to make simple, one-time fetch queries efficiently. |\n| Offline support | Cloud Firestore caches data that your app is actively using, so the app can write, read, listen to, and query data even if the device is offline. When the device comes back online, Cloud Firestore synchronizes any local changes back to Cloud Firestore. |\n| Designed to scale | Cloud Firestore brings you the best of Google Cloud's powerful infrastructure: automatic multi-region data replication, strong consistency guarantees, atomic batch operations, and ACID transaction support. We've designed Cloud Firestore to handle the toughest database workloads from the world's biggest apps. |\n| MongoDB compatibility | Cloud Firestore offers a MongoDB-compatible API. You can use existing MongoDB application code, drivers, tools, and the open-source ecosystem of MongoDB integrations with Cloud Firestore in the [Enterprise edition.](/docs/firestore/enterprise/mongodb-compatibility-overview) |\n\nHow does it work?\n\nCloud Firestore is a cloud-hosted, NoSQL database that your Apple, Android, and\nweb\napps can access directly via native SDKs. Cloud Firestore is also available\nin native Node.js, Java, Python, Unity, C++ and Go SDKs, in addition to REST and\nRPC APIs.\n\nFollowing Cloud Firestore's document data model, you store data that\ncontain fields mapping to values. These documents are stored in\ncollections, which are containers for your documents that you can use to\norganize your data and build queries. Documents support many different\n[data types](/docs/firestore/manage-data/data-types), from simple strings and numbers, to\ncomplex, nested objects. You can also create subcollections within\ndocuments and build hierarchical data structures that scale as your\ndatabase grows. The Cloud Firestore [data model](/docs/firestore/data-model) supports whatever\ndata structure works best for your app.\n\nAdditionally, querying in Cloud Firestore is expressive, efficient, and flexible.\nCreate shallow queries to retrieve data at the document level without needing to\nretrieve the entire collection, or any nested subcollections. Add sorting,\nfiltering, and limits to your queries or cursors to\npaginate your results. To keep data in your apps current, without retrieving\nyour entire database each time an update happens, add realtime listeners.\nAdding realtime listeners to your app notifies you with a data snapshot whenever\nthe data your client apps are listening to changes, retrieving only the new\nchanges.\n\nProtect access to your data in Cloud Firestore with Firebase Authentication and\nCloud Firestore Security Rules for Android, Apple platforms, and JavaScript, or Identity\nand Access Management (IAM) for server-side languages.\n\nImplementation path\n\n|---|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Integrate the Cloud Firestore SDKs | Quickly include clients via Gradle, CocoaPods, or a script include. |\n| | Secure your data | Use Cloud Firestore Security Rules or Identity and Access Management (IAM) to secure your data for mobile/web and server development, respectively. |\n| | Add Data | Create documents and collections in your database. |\n| | Get Data | Create queries or use realtime listeners to retrieve data from the database. |\n\nNext steps\n\n- [Get started](/docs/firestore/quickstart) with Cloud Firestore --- set up your database, then add data and start reading it.\n- Learn more about the Cloud Firestore [data model](/docs/firestore/data-model).\n- Explore the [differences between Realtime Database and Cloud Firestore](/docs/firestore/rtdb-vs-firestore)."]]