You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/09/28 12:28:40 UTC

[incubator-ponymail-foal] branch master updated: += info and create functions

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 3749502  += info and create functions
3749502 is described below

commit 374950223e284685622e92a4fcdd7b6514ca96eb
Author: Sebb <se...@apache.org>
AuthorDate: Tue Sep 28 13:27:49 2021 +0100

    += info and create functions
---
 server/plugins/database.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/server/plugins/database.py b/server/plugins/database.py
index c227a44..7e41d53 100644
--- a/server/plugins/database.py
+++ b/server/plugins/database.py
@@ -88,6 +88,16 @@ class Database:
         res = await self.client.index(index=index, **kwargs)
         return res
 
+    async def create(self, index=None, **kwargs):
+        """Create a new document (put if missing)"""
+        res = await self.client.create(index=index, **kwargs)
+        return res
+
+    async def info(self, **kwargs):
+        """Get ES info"""
+        res = await self.client.info(**kwargs)
+        return res
+
     async def update(self, index="", **kwargs):
         if not index:
             index = self.dbs.session