user_guide:howto:polydb_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
user_guide:howto:polydb_tutorial [2020/09/01 14:02] – [Inserting new Data] paffenholzuser_guide:howto:polydb_tutorial [2021/06/19 21:33] (current) – correction of a typo schroeter
Line 1: Line 1:
 ====== Introduction to polyDB ====== ====== Introduction to polyDB ======
  
-This tutorial explains how to access the [[:polydb|polyDB database]] from within polymake using the extension ''polyDB''. It comes bundled with ''polymake'', so there is no need to install extra software, except for the MongoDB.pm perl package. (This tutorial is for polymake version 4 and later. The old version is [[poly_db_tutorial|here]], but this needs also an old version of the database). If you encounter any errors or problems concerning ''polyDB'' ro the extension, please don't hesitate to [[https://forum.polymake.org/|ask in the forum]]. +This tutorial explains how to access the [[:polydb|polyDB database]] from within polymake using the extension ''polyDB''. It comes bundled with ''polymake'', so there is no need to install extra software, except for the MongoDB.pm perl package. (This tutorial is for polymake version 4 and later. The old version is [[poly_db_tutorial|here]], but this needs also an old version of the database). If you encounter any errors or problems concerning ''polyDB'' or the extension, please don't hesitate to [[https://forum.polymake.org/|ask in the forum]]. 
  
 The ''polymake'' extension is not necessary to use the data. You can access the data also  The ''polymake'' extension is not necessary to use the data. You can access the data also 
Line 260: Line 260:
 A new collection is started with the command<code>$polydb->initiate_collection(section=><section>, collection=><collection>);</code>If the collection should not be public, then also pas the option ''public=>false''. For a public collection the read access role of the new collection is added to the default role ''polymakeUser'' which is granted to every user of ''polyDB''. One can add this later if one wants to build up and test the collection befor making it publicly available.  A new collection is started with the command<code>$polydb->initiate_collection(section=><section>, collection=><collection>);</code>If the collection should not be public, then also pas the option ''public=>false''. For a public collection the read access role of the new collection is added to the default role ''polymakeUser'' which is granted to every user of ''polyDB''. One can add this later if one wants to build up and test the collection befor making it publicly available. 
  
-If this creates new intermediate subsections you should set the section documentation with <code>$polydb->set_section_doc(file=><file>);</code> so that the new collection appears in the list printed by ''db_info'' for all users with sufficient permissions. +If this creates new intermediate subsections you should set the section documentation with <code>$polydb->set_section_doc($doc, section=>...);</code> so that the new collection appears in the list printed by ''db_info'' for all users with sufficient permissions. 
  
 Note that the first command essentially only creates two new roles in MongoDB, one for read access to the collection (and all sections up to the root) and one for write access to the collection (and only to the collection, not to the sections). The actual collections are only created once the first document is written into the collection. This implies that collections will not be listed with ''db_info'' if any of the intermediate sections has no documentation, as then the collection where this is stored is not created.  Note that the first command essentially only creates two new roles in MongoDB, one for read access to the collection (and all sections up to the root) and one for write access to the collection (and only to the collection, not to the sections). The actual collections are only created once the first document is written into the collection. This implies that collections will not be listed with ''db_info'' if any of the intermediate sections has no documentation, as then the collection where this is stored is not created. 
  • user_guide/howto/polydb_tutorial.txt
  • Last modified: 2021/06/19 21:33
  • by schroeter