PageSourceSearch

https://docs.seekdb.ai/seekdb/assets/js/92c38a8b.97bd1ef8.js

js seekdb.ai collected 2026-10-04 15:22:20 UTC 7,343 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkionic_docs=self.webpackChunkionic_docs||[]).push([["124480"],{725071(e,n,l){l.r(n),l.d(n,{metadata:()=>i,default:()=>h,frontMatter:()=>o,contentTitle:()=>c,toc:()=>r,assets:()=>d});var i=JSON.parse('{"id":"reference/sdk/pyseekdb-sdk/apis/collection/list-collection-of-api","title":"list_collections - Get a list of collections","description":"The list_collections() API is used to obtain all collections.","source":"@site/docs/450.reference/900.sdk/10.pyseekdb-sdk/50.apis/200.collection/300.list-collection-of-api.md","sourceDirName":"450.reference/900.sdk/10.pyseekdb-sdk/50.apis/200.collection","slug":"/list-collection-of-api","permalink":"/seekdb/list-collection-of-api","draft":false,"unlisted":false,"editUrl":"https://github.com/oceanbase/seekdb-doc/edit/V1.4.0/en-US/450.reference/900.sdk/10.pyseekdb-sdk/50.apis/200.collection/300.list-collection-of-api.md","tags":[],"version":"current","sidebarPosition":300,"frontMatter":{"slug":"/list-collection-of-api"},"sidebar":"reference","previous":{"title":"fork - Fork a collection","permalink":"/seekdb/fork-collection-of-api"},"next":{"title":"count_collection - Count the number of collections","permalink":"/seekdb/count-collection-of-api"}}'),t=l(474848),s=l(28453);let o={slug:"/list-collection-of-api"},c="list_collections - Get a list of collections",d={},r=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Request parameters",id:"request-parameters",level:2},{value:"Request example",id:"request-example",level:2},{value:"Response parameters",id:"response-parameters",level:2},{value:"Response example",id:"response-example",level:2},{value:"Related operations",id:"related-operations",level:2}];function a(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"list_collections---get-a-list-of-collections",children:"list_collections - Get a list of collections"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"list_collections()"})," API is used to obtain all collections."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["This API is supported only when you use a Client. For more information about the Client, see ",(0,t.jsx)(n.a,{href:"/seekdb/client",children:"Client"}),"."]})}),"\n",(0,t.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["You have installed pyseekdb. For more information about how to install pyseekdb, see ",(0,t.jsx)(n.a,{href:"/seekdb/pyseekdb-sdk-get-started",children:"Quick Start"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["You have connected to the database. For more information about how to connect to the database, see ",(0,t.jsx)(n.a,{href:"/seekdb/client",children:"Client"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"request-parameters",children:"Request parameters"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"client.list_collections()\n"})}),"\n",(0,t.jsx)(n.h2,{id:"request-example",children:"Request example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'import pyseekdb\n\n# Create a client\nclient = pyseekdb.Client()\n\n# List all collections\ncollections = client.list_collections()\nfor coll in collections:\n    print(f"Collection: {coll.name}, Dimension: {coll.dimension}, embedding_function: {coll.embedding_function}, distance: {coll.distance}, metadata: {coll.metadata}")\n'})}),"\n",(0,t.jsx)(n.h2,{id:"response-parameters",children:"Response parameters"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Example value"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"name"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"The name of the collection."}),(0,t.jsx)(n.td,{children:"my_collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"dimension"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"No"}),(0,t.jsx)(n.td,{children:"Vector dimension."}),(0,t.jsx)(n.td,{children:"384"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"embedding_function"})}),(0,t.jsx)(n.td,{children:"EmbeddingFunction"}),(0,t.jsx)(n.td,{children:"No"}),(0,t.jsx)(n.td,{children:"The embedding function used by the collection."}),(0,t.jsx)(n.td,{children:"DefaultEmbeddingFunction(model_name='all-MiniLM-L6-v2')"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"distance"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"No"}),(0,t.jsx)(n.td,{children:"Distance metric."}),(0,t.jsx)(n.td,{children:"cosine"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"metadata"})}),(0,t.jsx)(n.td,{children:"dict"}),(0,t.jsx)(n.td,{children:"No"}),(0,t.jsx)(n.td,{children:"Reserved; currently unused."}),(0,t.jsx)(n.td,{})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"response-example",children:"Response example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"Collection: my_collection, Dimension: 384, embedding_function: DefaultEmbeddingFunction(model_name='all-MiniLM-L6-v2'), distance: cosine, metadata: {}\nDatabase has 1 collections\n"})}),"\n",(0,t.jsx)(n.h2,{id:"related-operations",children:"Related operations"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/create-collection-of-api",children:"Create a collection"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/get-collection-of-api",children:"Query a collection"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/get-or-create-collection-of-api",children:"Create or query a collection"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/fork-collection-of-api",children:"Fork a collection"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/count-collection-of-api",children:"Count collections"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/has-collection-of-api",children:"Check if a collection exists"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/seekdb/delete-collection-of-api",children:"Delete a collection"})}),"\n"]})]})}function h(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},28453(e,n,l){l.d(n,{R:()=>o,x:()=>c});var i=l(296540);let t={},s=i.createContext(t);function o(e){let n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.