Get the mapping of an Elasticsearch index in Python

Introduction to the _mapping schema for Elasticsearch schema The _mapping of an index in Elasticsearch is the essentially the schema for the documents. It’s the layout of the index’s fields that sets up a blueprint for storing and organizing fields, and their respective data, when documents are indexed to the Elasticsearch index. Getting the mapping … Continued

Index a Bytes String into Elasticsearch with Python

Introduction to Elasticsearch and Python The Python low-level REST client for Elasticsearch maps closely to the Java API for the Elasticsearch client. This article demonstrates how you can use the client to create a _mapping schema for a document with an encoded bytes string, and then index an encoded dictionary. The article will demonstrate how … Continued

Get MongoDB Database And Collection Names with PyMongo and Python

Introduction MongoDB stores its data (known as “documents”) by grouping them in collections that are themselves stored in a database. This article will help you to create database and collection names for a MongoDB server, and then it will help you to retrieve the database and collection names, in Python, with some example code. Prerequisites … Continued

Python Error Handling with the Psycopg2 PostgreSQL Adapter 645

Introduction This article will provide a brief overview of how you can better handle PostgreSQL Python exceptions while using the psycopg2 adapter in your code. Make sure that the psycopg2 package is installed on your machine using the PIP3 package manager for Python 3 using the following command: 1pip3 install psycopg2 We’ll also be building … Continued

What Is A PostgreSQL Cursor?

Introduction to Cursors in PostgreSQL If you’re writing code that interacts with PostgreSQL using Python or PHP, you’ll probably want to use cursors in your scripts. A PostgreSQL database cursor is a read-only pointer that allows a program, regardless of the language used, to access the result set of a query. This conserves the free … Continued

Create a PostgreSQL Database Using The Psycopg2 Python Library

Introduction to the psycopg2 Python adapter for PostgreSQL When you connect to PostgreSQL from a Python script, you can do much more than just query the database. You can insert rows into a table, create a new table and even create a new database. The psycopg2 adapter is a library that simplifies making SQL queries … Continued

Keep in the know!

Subscribe to our emails and we’ll let you know what’s going on at ObjectRocket. We hate spam and make it easy to unsubscribe.