Question: This is my firebase realtime database

[Image link](https://i.stack.imgur.com/ybpfj.png) 

This is the snippet i am using its always returning nil

```
let rootRef = Database.database().reference()
            rootRef.child("POSTS").queryLimited(toLast: 1).observeSingleEvent(of: .value) { (myDataSnap) in
                let value = myDataSnap.value as? NSDictionary
                print(value as? Any)
            }

```

Answer: 
Thank you for your very quick replies! I actually got my hands on some documentation about how to control and automate "Solibri IFC Optimizer" by hooking into its API. From what I know, this documentation isn't published somewhere on the internet yet so I would like to share it. This is how to control the program from the Windows command prompt or by using a .bat file:

**Solibri IFC Optimizer for Command Line Tool**

Example:

```
      c:\Program Files\Solibri\IFCOptimizer>"Solibri IFC Optimizer.exe" -in=d:\temp\model.ifc -out=d:\temp\model_optimized.ifc

```

Usage: 

```
      "Solibri IFC Optimizer.exe" [-license] [-help] [ [-rounding] [-force] -in=dir|file1[;file2;file3;...] [-out=[file|dir [-ifczip|-ifc] [-suffix=_optimized] ]]]

```

Description:

```
      Solibri IFC Optimizer is used for optimizing Open Standard IFC files. 
       Optimization is lossless and compression is approximately 5-10%.

```

Parameter List:

```
       -license   : Print license on screen and ignores other options.

       -help      : Prints this help message and ignores other options.

       -rounding  : Use floating point rounding.

       -force     : Force to overwrite existing compressed file(s) 
                    * Default action is to ask for confirmation.

       -in        : Source folder (optimizes ifc files from the folder)
                    or file(s) (separated by ';').

       -out       : Destination file or folder for compressed file(s).
                    * If destination is a file then -ifczip -ifc & -suffix are ignored.

       -ifczip    : Forces output file(s) to be compressed .ifczip file(s)
       -ifc       : Forces output file(s) to be uncompressed .ifc file(s)
                    By default output file(s) will be compressed .zip file(s).
                    * Last specified option will be used.

       -suffix    : Suffix to be added to compressed file(s) 
                    * Default suffix is "_optimized".

```
After receiving the documentation posted above, I managed to complete the script but I never posted it here. I'll post my solution for other people to find and use:

```
@echo off
SetLocal EnableExtensions EnableDelayedExpansion
chcp 65001

REM ----- DESCRIPTION -----
echo Optimizing IFC files located in the same directory as the script, using Solibri IFC Optimizer.

REM ----- LINE BREAK (REQUIRES TWO TRAILING BLANK LINES) -----
set br=^

REM ----- ITERATING IFC OPTIMIZATION AND FILE REPLACEMENT -----
set /a count=0
for %%f in (*.ifc) do (
    "c:\Program Files\Solibri\IFCOptimizer\Solibri IFC Optimizer.exe" -in="%cd%\%%f" -out="%cd%" -ifc -force
    set filename_ext=%%f
    set filename=!filename_ext:~0,-4!
    move "%cd%\!filename!_optimized.ifc" "%cd%\!filename!.ifc"
    set "file_list=!file_list! !filename! !br!"
    set /a count += 1
)

msg * "The following !count! IFC files were optimized: !br!!br!"^
!file_list!

exit

```