I Want to create a temp collection in mongodb just like temp table in Sql Server.If it is possible then please let me know how can I do this.
A valuable alternatives for the SQL temp table and table variable are SCHEMA_ONLY Memory-Optimized tables and the Memory-optimized Table Variable, where the data will be completely stored in the memory without the need to touch the TempDB database, providing the best data access performance.
Create a Global Temporary Table in SQL Server. You can also create a global temporary table by placing double hash (##) before the temporary table name. The global temporary table will be available across different connections. 3 records will be inserted into the table.
SQL Server provides two types of temporary tables according to their scope: Local Temporary Table. Global Temporary Table.
SQL Server uses the TempDB database for working storage of temporary tables and temporary stored procedures.
No there are no temporary collections.
You may have a look at capped collections which "are fixed-size collections" and they behave like this: "once a collection fills its allocated space, it makes room for new documents by overwriting the oldest documents in the collection."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With